6 kyu

Make the Deadfish Swim

10,147 of 38,757NullData

Description:

Create a parser to interpret and execute the Deadfish language.

Deadfish operates on a single value in memory, which is initially set to 0.

It uses four single-character commands:

  • i: Increment the value
  • d: Decrement the value
  • s: Square the value
  • o: Output the value to a result array

All other instructions are no-ops and have no effect.

Examples

Program "iiisdoso" should return numbers [8, 64].
Program "iiisdosodddddiso" should return numbers [8, 64, 3600].

Parsing
Algorithms

Stats:

CreatedJul 12, 2013
PublishedJul 12, 2013
Warriors Trained58524
Total Skips5845
Total Code Submissions95886
Total Times Completed38757
JavaScript Completions10147
CoffeeScript Completions135
C# Completions2597
Rust Completions1819
Python Completions9822
Haskell Completions382
PHP Completions1846
C Completions1548
Go Completions2402
Ruby Completions514
Java Completions4886
Scala Completions356
Groovy Completions121
Julia Completions110
TypeScript Completions2626
PowerShell Completions134
COBOL Completions12
D Completions13
Factor Completions10
Dart Completions99
Nim Completions9
VB Completions7
C++ Completions333
Kotlin Completions127
Lua Completions24
Crystal Completions3
Total Stars485
% of votes with a positive feedback rating91% of 3416
Total "Very Satisfied" Votes2862
Total "Somewhat Satisfied" Votes515
Total "Not Satisfied" Votes39
Ad
Contributors
  • NullData Avatar
  • Unnamed Avatar
  • suic Avatar
  • anter69 Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • adrian.eyre Avatar
  • Blind4Basics Avatar
  • nomennescio Avatar
  • Souzooka Avatar
  • LastPossum Avatar
  • metagn Avatar
  • AJFarmar Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • skaarj1989 Avatar
  • Just4FunCoder Avatar
  • razetime Avatar
  • FandaL Avatar
  • AVElfallah Avatar
  • Baselzockt Avatar
  • KayleighWasTaken Avatar
Ad