Showing posts with label code-golf. Show all posts
Showing posts with label code-golf. Show all posts

Wednesday, May 30, 2012

Is there a better way of writing v = (v == 0 ? 1 : 0);


I want to toggle a variable between 0 and 1. If it's 0 I want to set it to 1, else if it's 1 I want to set it to 0.

Friday, May 4, 2012

garble function contest


Remember that away message on aim that said how:




Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.