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: | 923 |
Nodes: | 10 (0 / 10) |
Uptime: | 95:12:54 |
Calls: | 12,227 |
Files: | 186,538 |
Messages: | 2,243,831 |