Solve this problem:--- Synchronet 3.20a-Linux NewsLink 1.114
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: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 920 |
Nodes: | 10 (1 / 9) |
Uptime: | 82:44:20 |
Calls: | 12,187 |
Calls today: | 2 |
Files: | 186,526 |
Messages: | 2,237,011 |