thingsinjars

  • 31 Dec 2024

    Torch? Again?

    It must be re-run season.

    After recently rebuilding Torch in ASCII using Phoenix and Elixir, I was inspired to do it yet again but with the original ray-casting-on-canvas look.

    This is a super-simple express server with websockets and in-memory state. The more complicated multi-player raycasting makes a return this time though (no list comprehension shortcuts when we're doing it this way, unfortunately.

    I still think there's some fun to be had in this game and maybe in another 15 years or so, I'll rebuild it again.

    Github Repo: https://github.com/thingsinjars/torch-js

    Development, Ideas, Toys, Geek, Javascript

  • 27 Dec 2024

    Torch in Phoenix

    In an old, old callback, I decided to revisit a game design from… almost 14 years ago?!

    Torch

    I was looking for an excuse to play with Elixir and Phoenix and decided the best thing to do would be grabbing an old idea and throwing some new tech at it.

    And, to mix things up, why not restyle it to look like a very old idea?

    ASCII Torch

    Using ASCII for this meant that I could actually do a lot of the visibility and ray casting using simple list comprehension (i.e. intersect all other player's 'lighted' cells with the current player's 360 ray cast visibility)

    Github Repo: https://github.com/thingsinjars/torch

    Development, Geek, Toys

  • 5 Dec 2024

    Snex – Multiplayer Snake

    It's been a few years since I built anything in Elixir so I decided this weekend to refresh my memory.

    Rather than build yet another location-based API, I decided to try a game.

    Combining super-simple gameplay and Phoenix Channels, I eventually ended up with Snex - Multiplayer Snake.

    On page load, you are assigned a random session ID so you can copy-paste the URL and share it with any one to play on the same board.

    I've currently got it deployed on Gigalixir.

    The performance on the deployed version isn't great due to network latency. Essentially, the game ticks every 100ms and sends an update to each player so if you're moving left then press down, typically the server will process one more left event before your down arrives. There are plenty of blog posts about handling latency, not just in multiplayer online games but also specific discussions on multiplayer online snake. I decided I could either dig into refreshing my knowledge of that or stick with refreshing my knowledge of Elixir and Phoenix. I went with the latter.

    github.com/thingsinjars/snex

    Geek, Toys

  • 16 Sep 2023

    Operations: A Maths Game

    Operations

    1+ players

    The aim is to get the highest number possible after using each of your tokens.

    There is 1 die

    Each player has 4 tokens with different symbols on:

    + − × ÷

    Each player rolls the die and the number they get is their starting number.

    Lowest score starts. If there's a draw, youngest of those starts.

    Each round:

    1. Roll the die
    2. Choose one of your operations.
    3. Perform your operation with the new number and your existing number. Try to get the highest score
    4. Discard your operation token. You only get to use each operation once.

    Note: When the calculation is a division with a remainder, you can either discard the remainder or continue with decimals, depending on who is playing.

    Example game:

    2 players.

    A rolls 2, B rolls 3. A has the lowest starting number so they start

    1. Round 1
      • A rolls a 4. They decide to use their + operation. They now have 6.
      • B rolls a 1. They use their ÷ . They still have 3.
    2. Round 2
      • A rolls 6. They use their × . They have 36.
      • B rolls 5. They use their × . B now has 15
    3. Round 3
      • A rolls another 6. They've already used their × so they have to either subtract 6 or divide by 6. They use − . They have 30
      • B rolls 2. They + it. B has 17
    4. Round 4
      • A rolls another 6! Now they only have their ÷ left. They have to divide 30 by 6. Now they have 5.
      • B rolls 3. They have their − left. B has 14.

    B wins.

    Variations

    • For advanced maths, add in the power and root symbols ^ √
    • Try to get the lowest score instead of the highest.
    • Try to get the lowest score without going below zero.

    Geek, Toys, Ideas

  • older posts

Categories

Toys, Guides, Opinion, Geek, Non-geek, Development, Design, CSS, JS, Open-source Ideas, Cartoons, Photos

Shop

Colourful clothes for colourful kids

I'm currently reading

Projects

  • Awsm Street – Kid's clothing
  • Stickture
  • Explanating
  • Open Source Snacks
  • My life in sans-serif
  • My life in monospace
Simon Madine (thingsinjars)

@thingsinjars.com

Hi, I’m Simon Madine and I make music, write books and code.

I’m the Engineering Lead for komment.

© 2025 Simon Madine