PRNG: Pseudo Random Number Generator
I don't quit understand how the rand function works in this JAPH. That's part of what makes it a cool JAPH; I don't quite understand it.
| [reply] |
Ah, thanks!
The key idea is that if you print a string of length n, then "\r", and then a string of length n-1, the last char of the first string remains visible.
The loop just prints random strings of length $" (followed by "\r") until the last char matches the corresponding char in "Just another Perl hacker,". Then $" is decremented, and this is repeated until $" is zero. The explanation might or might not help.
I got somewhat esoteric ideas when golfing this and the final JAPH is indeed quite difficult to understand; even for me, after not thinking about it for a while.
| [reply] |