# Hexidecimal Math Game

**URL:** <https://discourse.elm-lang.org/t/hexidecimal-math-game/9606>\
**Category:** Show and Tell\
**Created:** [January 24, 2024, 3:24am UTC](https://discourse.elm-lang.org/t/hexidecimal-math-game/9606 "2024-01-24T03:24:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnetize2072](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Magnetize2072](https://discourse.elm-lang.org/u/Magnetize2072)\
**Post date:** [January 24, 2024, 3:24am UTC](https://discourse.elm-lang.org/t/hexidecimal-math-game/9606/1 "2024-01-24T03:24:00Z")

</div>

I made a (quick) game to practice Hexidecimal addition and figured I’d share here:

The game itself - [HexMath](https://matt-savvy.github.io/hex_math/)  
Source - [GitHub - matt-savvy/hex\_math: Game to Practice Hexidecimal Math](https://github.com/matt-savvy/hex_math)

Wrote this in basically two sittings - one to make the game itself and one to actually handle the styling + css.

Found some good excuses to play with fuzz tests - for example, when converting from an integer to a hexidecimal, I know that any integer in a certain range is going to be a certain amount of digits:

```elm
fuzz (intRange 16 255) "16-255 is two digits" <|
  \n -> Expect.equal (String.length (toHex n)) 2

```

Shout out to @isaacvando for sharing [elm-to-gh-pages](https://github.com/isaacvando/elm-to-gh-pages) - it worked like a charm.

---

<div class="post-metadata">

**Author:** ![isaacvando](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/isaacvando/32/5002_2.png) [@isaacvando](https://discourse.elm-lang.org/u/isaacvando)\
**Post date:** [January 24, 2024, 4:05am UTC](https://discourse.elm-lang.org/t/hexidecimal-math-game/9606/2 "2024-01-24T04:05:24Z")

</div>

This is a great idea! I think I improved my skills significantly just from doing 5 or so problems 😃.

Glad to hear that the GitHub actions workflow worked well for you!

---

<div class="post-metadata">

**Author:** ![Magnetize2072](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Magnetize2072](https://discourse.elm-lang.org/u/Magnetize2072)\
**Post date:** [January 24, 2024, 4:13am UTC](https://discourse.elm-lang.org/t/hexidecimal-math-game/9606/3 "2024-01-24T04:13:17Z")

</div>

> This is a great idea!

Reading a book about assembly and it suggested practicing hex addition. I was surprised when I couldn’t find any simple programs like this.

> Glad to hear that the GitHub actions workflow worked well for you!

I think this is the perfect kind of project for it - a simple, self contained (as in, frontend-only) app.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [February 3, 2024, 4:13am UTC](https://discourse.elm-lang.org/t/hexidecimal-math-game/9606/4 "2024-02-03T04:13:27Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
