6 kyu

Make the Deadfish Swim

10,114 of 38,485NullData

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 Trained58121
Total Skips5800
Total Code Submissions95329
Total Times Completed38485
JavaScript Completions10114
CoffeeScript Completions135
C# Completions2587
Rust Completions1812
Python Completions9745
Haskell Completions381
PHP Completions1830
C Completions1537
Go Completions2391
Ruby Completions512
Java Completions4853
Scala Completions355
Groovy Completions120
Julia Completions109
TypeScript Completions2601
PowerShell Completions131
COBOL Completions12
D Completions13
Factor Completions10
Dart Completions85
Nim Completions9
VB Completions5
C++ Completions313
Kotlin Completions114
Lua Completions23
Crystal Completions3
Total Stars479
% of votes with a positive feedback rating91% of 3401
Total "Very Satisfied" Votes2849
Total "Somewhat Satisfied" Votes513
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