Core concept being same as another
Length of Duration Underground
How long does the mole stay underground? For the 'Hello world!' example, since the first two
$ values is
9, the mole performs
8 underground actions. However, at the end of the same example, the value is
8, which is insufficient since the mole needs to perform
8 underground actions. I changed it to
9, but now I'm unsure. What makes me unsure is the fact that, in the
cat example, the value is
2, but the mole performs
2 actions. For my interpreter, I choose the
value - 1 interpretation.
- The mole starts at 0 when encountering a
$the tile after that is 1. The last tile is executed, then you go back up. Hope that clears it up. --Emerald (talk) 14:41, 9 July 2020 (UTC)
- It seems Hello World is broken, also how do you use your implementation?
- If you go to my Github link and click on the ‘cell-based’ folder, you can download dig.py and run the program in the command line. The first argument should be the name of the file containing your dig program. Also, how can both examples be correct? If ‘hello world’ is correct, cat should contain a 3 instead, otherwise the mole surfaces too early and doesn’t execute the second underground command. If cat is correct, hello world should contain 8s instead, otherwise the mole surfaces too late and doesn’t execute the $ command. Bangyen (talk) 15:18, 9 July 2020 (UTC)
- You can count each instruction that continues after $
>$H:e:l:l:$o:%:W:o:$r:l:d:!:@ 8 8 0 8 0123456780123456780123456780
- You can watch my implementation: Dig.lua.
- The main problem is how to count, you can count from 1 or 0 and the code will change, I think the correct thing would be to count from 0, so if the number is 8, it will count exactly 8 instructions below.