A discrete 2D game on a rectangular grid: towardsdatascience.com/reinforcement-learning-implement-grid-world-from-scratch-c5963765ebff
This is analogous to many traditional board games such as Chess, the concept is very natural and maps well into computer.
The downsides of gridworld games are:
- it is hard to model speed in discrete worlds. When you 10x faster, when do you collide with something else that is also crossing your path?
- they tend to not use vector representations of objects. So to have an object be 10x longer than another one, the naive implementation has to add 10 smaller objects. This becomes untenable as the number of objects increases.
Although Ciro Santilli is a big fan of plaintext files and of Vim, not so for games. Games must be easy to understand since they are just a toy.
Tilesets to the rescue!
There is great beauty here. Great beauty. It's pure terminal poetry.
The most canonical source code Ciro Santilli can find right now is: sources.debian.org/src/bsdgames/
Many of the games are disabled by default on Ubuntu. But we can enable some games and build from source with:
apt-get source bsdgames
cd bsdgames-*
sed -ri '/^bsd_games_cfg_no_build_dirs=/s/ number / /' config.params
./configure
make -j
Here we enabled the game number, so now we can:which gives:
number/number 123
one hundred twenty-three.
We can also "install" it locally with:which puts the games locally under:which you can add to your
make install
debian/bsdgames/usr/games/number
PATH
environment variable.Tested on Ubuntu 24.04, bsdgames 2.17.
Converts numberical numbers to their full English form: unix.stackexchange.com/questions/413441/converting-numbers-into-full-written-words
For example:gives:
number 123456789123456789123456879123456789123456789123456879
one hundred twenty-three sexdecillion.
four hundred fifty-six quindecillion.
seven hundred eighty-nine quattuordecillion.
one hundred twenty-three tredecillion.
four hundred fifty-six duodecillion.
seven hundred eighty-nine undecillion.
one hundred twenty-three decillion.
four hundred fifty-six nonillion.
eight hundred seventy-nine octillion.
one hundred twenty-three septillion.
four hundred fifty-six sextillion.
seven hundred eighty-nine quintillion.
one hundred twenty-three quadrillion.
four hundred fifty-six trillion.
seven hundred eighty-nine billion.
one hundred twenty-three million.
four hundred fifty-six thousand.
eight hundred seventy-nine.
It also takes input from stdin, e.g.:gives:
primes 1 10 | number
two.
...
three.
...
five.
...
seven.