Deadfish interpreter written in Ruby (http://esolangs.org/wiki/Deadfish)
#!/usr/bin/env ruby | |
n = 0 | |
while true | |
print '>> ' | |
gets.chomp.each_char do |c| | |
n = 0 if [-1, 256].include?(n) | |
case c | |
when 'd' then n -= 1 | |
when 'i' then n += 1 | |
when 'o' then puts n | |
when 's' then n *= n | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment