In C (and in bash, I tried some constructs and ended with a solution that I thought correct but of which the interpreter is not happy. It gives the following error: Expected a movement (one of N, NE, E, SE, S, SW, W, NW) but found ‘W’
any hints for the c-version to cut the size down? I’m at 191 for c++, but out of ideas without hardcoded stuff… ternary was a nice tip! currently cin take much characters, but I have no idea how to shorten that.
I reached down to 178 in C++, but that’s how far it goes.
Even by omiting the part for walking north, I would lose only ten additional characters.
I wonder how some got less than 100
You can increment the variable in the output with ++ operator.
In my code I have only the output in the for loop, this way you can leave the curly brackets too.
Hard coded 158 in Java. But I honestly have no idea how to get it done in less characters - and the best one in Java is at only 138. Plopx, please share your wisdom!
Hard coded 98 in C, with some tricks like getting the getchar()%9 to avoid comparing with two digit numbers, or testing a-x instead of a!=x, but blocked now… I think puts() is not right as it requiered two ", but no ideas on how to go shorter.