Script to run postgres in docker:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=admin -d postgresSome games will run in any postgres client, some will require psql terminal.
In tools folder you can find input.bash script that is used to send input to database.
It interacts with made by me get_key() function that will handle keyborad input.
For now it works with flappybird game, replacing second terminal used to send jump command.
In flappybird game you can use arrow up to jump.
To use input.bash run it as it was psql command, for example:
./tools/inputs.bash -U postgres -p 5432 -h 127.0.0.1Will run in any postgres client
2048 game written in sql, because I was bored on weekend.
Run given sql script (2048.sql) in yor postgres database. Instruction how to play will be shown after import or you can read them here:
To start game run SELECT * FROM init();
To move run:
- up:
SELECT * FROM up(); - down:
SELECT * FROM down(); - left:
SELECT * FROM left(); - right:
SELECT * FROM right();
Requires psql client
Flappybird in sql. To run you need to run from psql termianl.
- Launch psql:
psql -U postgres -p 5432 -h 127.0.0.1 - Import
flappybird.sql(eq.\i flappybird.sql) - Run
CALL start() - From other terminal or some other postgres client run query
CALL jump()to jump.
Requires psql client
Wordle game in sql. To run you need to run from psql termianl.
- Launch psql:
psql -U postgres -p 5432 -h 127.0.0.1 - Import
wordle.sql(eq.\i wordle.sql) - Import word list from
wordle_words.sql(eq.\i wordle_words.sql) - Run
CALL play()and thenCALL play('word')to guess word. - To reset just run
CALL play()again.