Skip to main content
scragar's user avatar
scragar's user avatar
scragar's user avatar
scragar
  • Member for 10 years, 5 months
  • Last seen more than 4 years ago
  • N/A
  • United Kingdom
comment
If a program terminates and there is no one to see it, does it halt?
@Sparr One of the rules is to assume infinite stack and heap size.
comment
Tips for golfing in <all languages>
Also in some languages(if supported) if your numbers are large/small enough the scientific notation may actually save you some chars instead: if(n>99999) vs if(n<1e5)
awarded
comment
Tips for golfing in <all languages>
B>A or foo() would be an even shorter way to express this, take advantage of lazy evaluation of boolean expressions to ensure it only calculates things when it needs to.
comment
Tips for golfing in <all languages>
If you're counting bytes instead of unicode then using extended ascii might be a way to squeeze another ~120 identifiers if you need them(not that for a golf script you should need more than 26 anyway)
comment
Challenge: Write a piece of code that quits itself
Could you explain this solution? What exactly does BEGIN{END} do(or attempt to do)?
comment
Loop without 'looping'
It takes a string ("print 1;"), duplicates it 9 times(*9), then executes the resulting string(exec). Repeating a chunk of code without actually looping at all.
comment
Loop without 'looping'
It's still recursive, you're just doing it with two alternate layers.
comment
Loop without 'looping'
@TeunPronk yes is a bash command that prints out the word yes until it's killed or the stream becomes closed. If it's writing to the screen it'll never stop until you kill it. It's kind of cheating though, since it's a command that basically consists of a loop over printf.
comment
Make a finky syntax checker
@eithedog I've managed to resolve that problem, but it's still not quite safe, since it's still possible to generate SyntaxErrors by using internal eval statements. jsfiddle.net/kA2Wv
comment
Make a finky syntax checker
@eithedog Sorry, got confused on languages, Javascripts base throwable is actually called Error, not Exception. throw new Error('') causes the incorrect behaviour.
awarded
comment
Good Versus Evil
@plannapus I'm going to guess the assumption with this bot is that everyone else is going to err on the side of caution and avoid anything close 1 seconds worth of wait. I'm thinking it may be worthwhile submitting and entry that consists of a 0.9 second wait, before returning "good", just to mess with him. Actually, SBoss has beat me to it :D
awarded