[48in24 Exercise] [08-06] Robot Simulator

This issue is a discussion for contributors to collaborate in getting ready to be featured in 48in24. Please refer to this forum topic for more info.

We will be featuring Robot Simulator from Aug 06 onwards.

Staff jobs

These are things for Erik/Jeremy to do:

  • ☐ Check/update exercise in Problem Specifications
  • ☐ Create + schedule video

Community jobs

For each track:

  • Implement Robot Simulator
  • Add approaches (and an approaches introduction!) for each idiomatic or interesting/educational approach.
  • Add video walkthroughs (record yourself solving and digging deeper into the exercise).
  • Highlight up to 16 different featured exercises (coming soon)

Existing Approaches

You can use these as the basis for approaches on your own tracks. Feel free to copy/paste/reuse/rewrite/etc as you see fit! Maybe ask ChatGPT to translate to your programming language.

Track Statuses

You can see an overview of which tracks have implemented the exercise at the #48in24 implementation status page.

I’ve currently gathered the following solutions to feature:

  1. Wren: mutable data and lookup tables
    Use mutable data and lookup tables

  2. Kotlin: mutable data using extension functions
    Mutable data and use extension function for nice ergonomics

  3. Python: clever assignment of values of direction and moves
    Assign degrees to direction to help simplify moving and moves are positive or negative

  4. C: use modulo logic and lookup arrays for direction and move mutation
    Use modulo logic and lookup array for direction and move mutation

  5. F#: immutable data type, pattern matching and fold
    Use pattern matching for the move left and right and advance and fold for the instruction

  6. Gleam: immutable data type, exhaustive pattern matching and fold
    Exhaustively list all possible combinations of position/direction/instruction and use fold

  7. Crystal: trigonometry
    Use trigonometry

  8. Python: complex data type
    Model the direction and coordinate as complex numbers

If anyone has more suggestions, do let us know!

Using complex data types: IsaacG's solution for Robot Simulator in Python on Exercism

1 Like

That’s a lovely solution!

1 Like

I sometimes like to use trigonometry: glennj's solution for Robot Simulator in Crystal on Exercism

1 Like