Hangman Word collections


During last days I have been working on the Word database...

Previous versions were using just a long string, in a custom format similr to CSV. Just semi-colon to split the records (words) and comma to split the fields/columns.

English,animals,jellyfish;English,animals,duck;English,animals,goose;Français,animaux,chat;Français,animaux,chien;Français,animaux,souris;Français,animaux,cheval;Français,animaux,vache;Français,animaux,cochon;Français,animaux,mouton;

That was a game specific solution so take advantage of the current rebuild I wanted a more general solution.

A key point was that it should be human readable. It's not fast but it helps a lot on development phase. So I review the options XML, JSON, CSV, YAML, ... And decided to use YAML because it is very simple with low extra meta data but as powerful as XML or JSON.

Parsing YAML is complex if you want to support the full specification, but after some headaches I realize that I don't need a database, I just need a table of records (Sequence of Mappings in YAML). Very easy to parse and read...

- language: English
  category: animals
  word: jellyfish
- language: English
  category: animals
  word: duck

Of course there are other ways to organize the same information in YAML, but that is easy at the moment.

So far, one system reads the table and keeps in memory all the maps. And returns them to the Hangman system.

Hangman system asks db system for a list of maps that matches a filter (example: "category=animals") and builds the Words that will be used in random order for the plays.


At the moment, I'm focused on the play of the game. So I only need to read the table and apply some filters. Later I'll take care of the create/update/delete words in the table.


Hangman

Get Hangman

Buy Now$5.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.