Codewars: Rust workspace for solving the 'Make the Deadfish Swim' kata
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
354 B

  1. ## Make the Deadfish swim
  2. Write a simple parser that will parse and run Deadfish.
  3. Deadfish has 4 commands, each 1 character long:
  4. - `i` increments the value (initially 0)
  5. - `d` decrements the value
  6. - `s` squares the value
  7. - `o` outputs the value into the return array
  8. Invalid characters should be ignored.
  9. ```rust
  10. parse("iiisdoso") => [ 8, 64 ]
  11. ```