Recent

How to generate a number between 1...n in Hugo

In Hugo you can use {{index (seq 18 | shuffle) 0}}.

  • What this is doing is basically making a sequence, list, of numbers from 1-18 with seq 18
  • Mixing up the list by shuffling the elements with shuffle
  • Then grabbing the first element by it’s index of zero index (seq 18 | shuffle) 0

Originally mentioned in Dev Diary 0001 - Week of October 2nd 2023

:

I just got so frustrated at a piece of code for work I took 20 minutes and rage cleaned my windows. Then I made a cup of tea, sat back down, and immediately saw the issue. So now I have working code and clean windows 😎

:

screenshot of an arctic hex-map for a rpg game

I made some progress on my little solo rpg quine idea this weekend. I’m using the hex generation rules from the welshpiper.com. I also picked up the icons from the HPS Cartography Kit. I’ve gotten as far as marking the major and minor encounters.

← Newer Posts Older Posts →

Featured Adventures

Move using the WASD keys or by clicking the boxes around the player.

Inventory

About