Skip to content

Instantly share code, notes, and snippets.

@abevoelker
Created July 1, 2013 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abevoelker/5901817 to your computer and use it in GitHub Desktop.
Save abevoelker/5901817 to your computer and use it in GitHub Desktop.
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