PHP, 133 bytes, cracked by Dennis
Easy one : (numbers are separated by pipe symbol)
for
(
putenv("num=".(int)(bool)NO);
getenv ("num") <= 100;
putenv("num=". (getenv("num") + 1))
)
printf("%d|", getenv("num"));
Catch :
No PHP variables in FOR loop
Code is made to be C-like syntax
Objective-C has macro named NO which is 0.
PHP has strange syntax construct "define without define" :
if interpreter finds unqualified token in code - it assumes that this token is an undefined constant and because it's value is unknown - value is taken from token name converted to a string constant. That's why NO get's interpreted as'NO'
and because all non-empty strings in PHP meanstrue
when converted to boolean - integer 1 is saved into environment variable in FOR loop initialization part. Fortunately this PHP behavior is now a deprecated featureThe only thing which truly reaveals that it is PHP code snippet - string concatenation operator
.
If PHP would have functionstrcat()
like C does - hiding dot from the reader would make code more inseparable from a C syntax.