aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-10-01 09:04:50 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2022-10-01 09:04:50 +0200
commitb473f7ce3895eccaf7691f6fc9296cb3c695a189 (patch)
treeee26300cebed966fab631ebc2549b0d58a68f8d2
parent152a9ea1ee5f12cae69448a4971adaa1b2fbcc17 (diff)
downloadsebastiano.tronto.net-b473f7ce3895eccaf7691f6fc9296cb3c695a189.tar.gz
sebastiano.tronto.net-b473f7ce3895eccaf7691f6fc9296cb3c695a189.zip
Added blog post
-rw-r--r--src/blog/2022-10-01-tetris/tetris.md147
-rw-r--r--src/blog/blog.md1
-rw-r--r--src/blog/feed.xml7
3 files changed, 155 insertions, 0 deletions
diff --git a/src/blog/2022-10-01-tetris/tetris.md b/src/blog/2022-10-01-tetris/tetris.md
new file mode 100644
index 0000000..de21b05
--- /dev/null
+++ b/src/blog/2022-10-01-tetris/tetris.md
@@ -0,0 +1,147 @@
1# The man page reading club: tetris(6)
2
3Sometimes you just need to relax and have some fun :-)
4
5## Boredom
6
7*"Phew, that was a long read!" you think as you reach the end of the
8`sh(1)` manual page. After such an intense brain-workout you would
9normally have a nice walk outside - but the Geiger counter on the wall
10tells you that this might not be a good idea in this timeline. Your second
11choice would be to have a beer and listen to some good music or watch a
12movie, but none of these options is available in the bunker. It's almost
13as if the nuclear winter is... bad?*
14
15*You try to think what else you can do to ease your boredom.
16There's no internet, no books, no videogames... wait a minute!*
17
18```
19$ man man
20```
21
22*You scroll down until you see the list of available sections, and
23you find the one you were looking for:*
24
25```
26 6 Games.
27```
28
29*Yes! You thought you saw this
30[some time ago](https://sebastiano.tronto.net/blog/2022-05-29-man),
31but you had ignored it. You also remember that the `intro(1)` page
32mentioned analogous intoductory pages for each section. So you type:*
33
34```
35$ man 6 intro
36```
37
38*And so you discover that the folder `/usr/games` contains dozens of
39games and other fun little programs. These are already installed in your
40system, no need to download files or insert CD roms.*
41
42*There is so much choice, so many games you have never heard of. But for
43this time you decide to go with a classic.*
44
45## tetris(6)
46
47*Follow along at [man.openbsd.org](https://man.openbsd.org/OpenBSD-7.1/tetris)*
48
49Before starting the game it is better to learn the rules, so let's type
50`man tetris` first!
51
52```
53DESCRIPTION
54 The tetris command runs a display-based game. The object is to fit
55 shapes together to form complete rows, which then vanish. When the
56 shapes fill up to the top, the game ends.
57```
58
59The default control keys are listed below:
60
61```
62 j move left
63 k rotate 1/4 turn counterclockwise
64 l move right
65 <space> drop
66 p pause
67 q quit
68```
69
70Some of the options are quite straightforward: `-c` to play in "classic
71mode", with a slightly different graphics and shapes that turn clockwise;
72`-l` to specify a level; `-p` to show the next shape that will drop, in
73exchange for a lower score; `-s` to print the highscores and exit. The
74most interesting is `-k`:
75
76```
77 -k keys
78 The default control keys can be changed using the -k option. The
79 keys argument must have the six keys in order; remember to quote
80 any space or tab characters from the shell.
81```
82
83The sections PLAY and SCORING explain the gameplay and the criteria for
84assigning points. There is also an ENVIRONMENT section with a single line:
85
86```
87 LOGNAME Name displayed in high score file.
88```
89
90This means that you can set that shell variable to have your score
91saved in the `$HOME/.tetris.score` file under a different name -
92this can be useful for example when lending your pc to someone else
93to let them play.
94
95## Having fun
96
97*"Enough of this reading, let's just play!"*
98
99*You decide to remap the keys to play with your left hand, and to use the
100old nick name you used on online forums, when the internet still existed.
101And why not trying the "classic" mode as well?*
102
103```
104$ LOGNAME=porkynator tetris -c -k 'asd pq'
105```
106
107*And you start playing the night away*
108
109```
110Score: 47 [] []
111 [] []
112 [] []
113 [] [] []
114 [] [][] []
115 [] [] []
116 [] []
117 [] []
118 [] []
119 [] []
120 [] []
121 [] []
122 [] []
123 [] []
124 [] []
125 [] []
126 [] [][]
127 [][][] [][]
128 [][][][] [][]
129 [][][][] [][]
130 [][][][][][][][][][][][]
131
132a - left s - rotate d - right <space> - drop p - pause q - quit
133```
134
135## Conclusions
136
137This was a short and unimportant post meant to cool down after last month's
138double post on the shell. I'll take it as an excuse to mention that `/usr/games`
139[won't be in the default `$PATH`](https://undeadly.org/cgi?action=article;sid=20220810120423)
140starting from OpenBSD 7.2. If you want to have a fun tetris session,
141in the future you might have to specify the full path
142
143```
144$ /usr/games/tetris
145```
146
147or just update your `$PATH`.
diff --git a/src/blog/blog.md b/src/blog/blog.md
index a1227f7..8399626 100644
--- a/src/blog/blog.md
+++ b/src/blog/blog.md
@@ -2,6 +2,7 @@
2 2
3[RSS Feed](feed.xml) 3[RSS Feed](feed.xml)
4 4
5* 2022-10-01 [The man page reading club: tetris(6)](2022-10-01-tetris)
5* 2022-09-20 [The man page reading club: sh(1) - part 2: commands and builtins](2022-09-20-sh-2) 6* 2022-09-20 [The man page reading club: sh(1) - part 2: commands and builtins](2022-09-20-sh-2)
6* 2022-09-13 [The man page reading club: sh(1) - part 1: shell grammar](2022-09-13-sh-1) 7* 2022-09-13 [The man page reading club: sh(1) - part 1: shell grammar](2022-09-13-sh-1)
7* 2022-09-10 [Long live netbooks!](2022-09-10-netbooks) 8* 2022-09-10 [Long live netbooks!](2022-09-10-netbooks)
diff --git a/src/blog/feed.xml b/src/blog/feed.xml
index d8e7876..1cf4313 100644
--- a/src/blog/feed.xml
+++ b/src/blog/feed.xml
@@ -9,6 +9,13 @@ Thoughts about software, computers and whatever I feel like sharing
9</description> 9</description>
10 10
11<item> 11<item>
12<title>The man page reading club: tetris(6)</title>
13<link>https://sebastiano.tronto.net/blog/2022-10-01-tetris</link>
14<description>The man page reading club: tetris(6)</description>
15<pubDate>2022-10-01</pubDate>
16</item>
17
18<item>
12<title>The man page reading club: sh(1) - part 2: commands and builtins</title> 19<title>The man page reading club: sh(1) - part 2: commands and builtins</title>
13<link>https://sebastiano.tronto.net/blog/2022-09-20-sh-2</link> 20<link>https://sebastiano.tronto.net/blog/2022-09-20-sh-2</link>
14<description>The man page reading club: sh(1) - part 2: commands and builtins</description> 21<description>The man page reading club: sh(1) - part 2: commands and builtins</description>

Generated with cgit - Back to sebastiano.tronto.net