2 ms·
The tinkering with the Integer cache to make 2 + 2 = 5 : https://codegolf.stackexchange.com/a/28818 https://codegolf.stackexchange.com/a/28818 The trick is to
by shagie 5y ago
The tinkering with the Integer cache to make 2 + 2 = 5 : https://codegolf.stackexchange.com/a/28818 https://codegolf.stackexchange.com/a/28818
The trick is to make the int literal to get boxed so that it hits the cache - which requires a printf (rather than println).
And yea, don't do this.
- Turing_Machine 5y agoThere was an old-time "hacker test", one of the questions of which was "Ever change the value of 4? In a language other than FORTRAN?" So I guess the answer here would be "yes" to both parts. Well done!
- MaxBarraclough 5y agoAs an occasional dabbler in Forth, I can answer in the affirmative. Well, I'm not sure I redefined 4 specifically, but I tried out redefining a few integer literals.