And there was the guy (I honestly cannot remember his name. Pretty sure it was in China, though) that had very few men to defend a city. So he left the gates open and played an instrument in it. The guys SUPPOSED to be besieging thought it was a trap and left.
It's happened several times throughout history when enemies faced generals and warlords who had reputations for being cunning tactical geniuses. The enemy would see aforementioned warlord in an obviously disadvantaged position, ripe for the slaughter - and the enemy would assume this is only because that general wants it to appear so right before the ambush. And then it turns out they were bluffing and counting on their reputation for cunning stratagems to trick the enemy into being overcautious.
The one you're referring to is Zhuge Liang's work, and is legendary and possibly mythical; it nonetheless makes a good story. Zhuge Liang has very few soldiers left, Sima Yi is marching on the city he's stuck in and Zhuge Liang orders all the gates be opened and all his soldiers dress up as civilians to sweep the streets while he calmly played his Guqin, which is like a guitar if you played it with the instrument resting on a table. The tension comes about in that if he played a single note wrong and showed his anxiety, Sima Yi would march through the city and kill him. He maintains his calm composure and Sima Yi is unnerved by this, as Zhuge Liang has a reputation for being so calculative he literally does math calculations for fun in his spare time. He makes the judgement that Zhuge Liang would not be so calm and would not make such a risk as Zhuge Liang never takes risks, thinking that Zhuge Liang's apparent weakness is just a sign of his surety in his safety - there must be an ambush within the city. He withdraws his armies.
Eventually he figures out what just happened, but by then Zhuge Liang already escaped.
My favourite one has to be when Zhuge Liang invented the wheelbarrow, had his men use the wheelbarrow to transport grain across the treacherous mountain roads (whose bridges had been sabotaged by Sima Yi), then had his wheelbarrows deliberately captured by Sima Yi. It doesn't end there, as Sima Yi sees the wheelbarrow and thinks "this is awesome, reverse engineer it and manufacture it at once" to also increase the strength of his own supply trains. He loads up his grain on these wheelbarrows and sends them to a secure mountain Fortress. This supply train is intercepted by some soldiers claiming to be from Sima Yi, in reality they are Zhuge Liang's troops who have marched deep into enemy territory wearing enemy uniforms - they take the grain, the captured wheelbarrows and bring them back to friendly lines to save the campaign which was about to end due to starvation.
The guy did math for fun