Compare commits

...

2 Commits

Author SHA1 Message Date
53e86fb86e
board games with recfiles 2025-02-10 01:02:12 +01:00
6b4a846284
note makefile help 2025-02-09 22:20:16 +01:00
4 changed files with 82 additions and 0 deletions

View File

@ -44,6 +44,7 @@ recsel $database
```
- [Extended example](recfiles/extended.md)
- [Playing with board games data](recfiles/Board_Games.md)
# Resources

View File

@ -0,0 +1,61 @@
---
title: "Board Games"
tags: [ "data", "recfiles" ]
---
You can play with a board games database from boardgamegeek.com.
## Download the Database
```sh
mkdir board_games
cd board_games
curl -Lo bg.zip 'https://www.kaggle.com/api/v1/datasets/download/threnjen/board-games-database-from-boardgamegeek'
unzip bg.zip
```
The header line shows fields with a bunch of colons, which will confused `recutils`, so we'll have to get rid of them.
```sh
sed -i '1s/://g' *.csv
```
Convert the games to `.rec` format.
```sh
csv2rec games.csv > games.rec
```
## Queries
If you try to look at older games, you'll find lots of results.
```sh
recsel games.rec -e "YearPublished < 1800" -c
recsel games.rec -e "YearPublished < 1800" -Cp Name
```
But most are wrong.
The problem is games with a `YearPublished` date of `0`, probably because the year published is unknown.
```sh
recsel games.rec -e "Name = 'The Goblin King is Angry'" -p YearPublished
```
Fix the query by removing games published in '0 AD'.
```sh
recsel games.rec -e "YearPublished < 1800 && YearPublished != 0" -R YearPublished,Name
```
Or fix the database setting `YearPublished` to 'unknown':
```sh
recsel games.rec -e "YearPublished = 0" -Cp Name
recset games.rec -e "YearPublished = 0" -f "YearPublished" -S 'unknown'
```
Strategic games which work best with 3 players, sorted by Average Rating:
```sh
recsel games.rec -e "BestPlayers = 3 && CatStrategy = 1" -CR Name --sort=AvgRating
```

View File

@ -183,3 +183,5 @@ In this case, the makefile can see that `backup` depends on the current backup f
- [File patterns](Makefiles/patterns.md)
- [Makefile graphs](Makefiles/graph-easy.md)
- [In-build help](Makefiles/help.md)
- [Makefile graphs](Makefiles/graph-easy.md)

18
system/Makefiles/help.md Normal file
View File

@ -0,0 +1,18 @@
---
title: "Makefiles"
tags: [ "system", "makefiles", "help" ]
---
Make your first target 'help' to give an overview of the main targets.
Running `make help` will search for text which starts with `## ` and show what that target does.
```make
help: ## Print the help message
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
sort | \
column -s ':' -t
clean: ## Remove generated files
$(RM) $(defaults)
```