r/programming • • Aug 30 '15

JavaScript “maze generator” in a tweet

https://twitter.com/botond_balazs/status/637960240055615488
841 Upvotes

177 comments sorted by

View all comments

Show parent comment

1

u/Anders_A Aug 30 '15

ooh! Nice trick to force a type cast. I was experimenting with stuff like

"\u2571\u2572"[(Math.random()<.5) + 0]

But didn't help much. Clever!

3

u/matt_hammond Aug 30 '15

I tried

[+(Math.random()<.5)] 

Its a bit shorter