Solve this problem:
Deadfish is one of the best known non Turing-complete programming languages. It has only one accumulator (which starts at 0) to store
data, and only four commands:
i - Increment the accumulator
s - Square the accumulator
d - Decrement the accumulator
o - Output the accumulator
Create a program that will input a number and output Deadfish
code to display the number. It must work for any integer from 0 to 255.
https://codegolf.stackexchange.com/questions/40124/short-deadfish-numbers/
Twist, don't write the solution in Prolog. But in your favorite Prolog
with your favorite state extension. For example Mecury states via
(!)/1 or some other Prolog language extension that helps
dealing with state.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 491 |
Nodes: | 16 (3 / 13) |
Uptime: | 147:17:26 |
Calls: | 9,695 |
Calls today: | 5 |
Files: | 13,732 |
Messages: | 6,178,671 |