Player-Missile Graphics |
CZ |
Tato mysterka se nachází na městském pozemku spravovaném městskou částí Praha-Štěrboholy. Abych dodržel pravidlo geocachingu, podle kterého musím mít před umístěním kešky souhlas majitele nebo správce pozemku, konzultoval jsem umístění kešky se starostou městské části Praha-Štěrboholy. Děkuji panu starostovi za souhlas s umístěním kešky na tomto pozemku.
Listing je dlouhý, ale nebojte se ho, určitě vyluštění finálních souřadnic zvládnete.
Úvodní souřadnice ukazují na autobusovou zastávku, odkud se dá dojít k finálním souřadnicím. Autobusová zastávka není místo, kde se ukrývá keška.
Doporučuji zobrazit tento listing na počítači ve webovém prohlížeči, ne jen v mobilní aplikaci, protože bude užitečné mít možnost kopírovat část listingu do jiné aplikace.
K logování do logbooku doporučuji mít vlastní psací potřebu, ořezaná tužka nemusí být vždy k dispozici. Prosím, šetřete místem v logbooku.
V 80. letech 20. století už někteří z nás měli počítač, ale tehdejší počítače se od dnešních hodně lišily. Já jsem měl mikropočítač Atari 800 XE, který měl vestavěný programovací jazyk Atari Basic, 64 kilobytů paměti, osmibitový procesor 6502 s frekvencí 1,79 MHz, grafický čip ANTIC, čip POKEY pro klávesnici a zvuk, 4 zvukové kanály, uměl zobrazit nejvýše 128 barev, v základním textovém režimu uměl zobrazit nejvýše 24 řádků po 40 znacích, k uchovávání dat používal audiokazety nebo 5,25palcové diskety, neměl myš, ovládal se klávesnicí a jedním nebo dvěma joysticky a zobrazoval svůj vizuální výstup obvykle na televizoru. Klávesnice, procesor, další čipy a paměť tvořily dohromady jedno zařízení.
Mikropočítače Atari mají speciální technologii zvanou „Player-Missile Graphics“ (PMG, grafika hráčů a střel), určenou především pro hry. S touto technologií je možné zobrazit až čtyři hráče a čtyři střely nebo 5 hráčů bez střel. Každý z těchto objektů může mít jinou barvu. Tyto objekty se mohou pohybovat po obrazovce nezávisle na dalším obsahu obrazovky. Je možné určit, zda tyto PMG objekty budou zobrazené před, nebo za ostatními objekty zobrazenými na obrazovce (priorita zobrazení). Je možné detekovat kolize PMG objektů, což je důležité pro hry, kde potřebujeme vědět, kdy je hráč zasažen střelou, srazí se s nepřítelem nebo se dotkne předmětu, který má sebrat.
PMG objekt hráče má šířku omezenou na 8 pixelů. Jeho výška může zabírat celou výšku obrazovky. Musí se tudíž vejít do sloupce širokého 8 pixelů. Vodorovný pohyb objektu je jednoduchý, provádí se nastavováním horizontální pozice sloupce. Pro svislý pohyb objektu je nutné přesouvat číselnou definici objektu v rámci úseku paměti, odkud je zobrazován sloupec obsahující objekt.
Nebudu popisovat celý proces nastavení zobrazení PMG objektů, ale popíšu návrh PMG objektu hráče a převod mezi jeho vzhledem a jeho číselnou definicí, což je formát, ve kterém musí objekt být uložen do paměti. Pro návrh PMG objektu hráče potřebujeme čtvercovou síť o 8 sloupcích, do které nakreslíme objekt vyplněním některých čtverečků. Na obrázku 1 je příklad PMG objektu.
Obrázek 1: Příklad PMG objektu
Potom musíme vypočítat číselnou definici objektu. Každý řádek o 8 pixelech je popsaný jedním osmibitovým číslem (0 až 255). Když nahradíme prázdné čtverečky nulami a vyplněné čtverečky jedničkami, dostaneme osmimístný binární (dvojkový) zápis čísla, které potřebujeme získat. Abychom získali tato čísla v desítkovém zápisu, napíšeme nad sloupce zprava doleva mocniny čísla 2 (1, 2, 4, 8, 16, 32, 64, 128). Potom pro každý řádek vypočítáme součet čísel napsaných nad těmi sloupci, ve kterých je čtvereček v daném řádku vyplněný. Na obrázku 2 vidíme výpočet číselné definice objektu z obrázku 1.
Obrázek 2: Výpočet číselné definice PMG objektu z obrázku 1
Nyní víme, že číselná definice PMG objektu z obrázku 1 je tvořena čísly 60, 126, 219, 255, 189, 195, 126, 60. Počet čísel tvořících číselnou definici PMG objektu odpovídá počtu řádků obsazených tímto objektem.
Kromě návrhu PMG objektu se stejný postup používá i k návrhu znaků pro znakovou sadu, ale u znaků je i výška omezená na 8 pixelů.
Co když naopak máme jen číselnou definici neznámého PMG objektu, nevíme, jak vypadá, a chceme najít jeho vzhled? Musíme udělat to, co by s jeho číselnou definicí udělal počítač Atari. Potřebujeme převést každé z osmibitových čísel na jeho osmimístný binární zápis. Je několik způsobů, jak se to dá provést.
a) Ruční výpočet
|
1.
|
Nechť n je číslo, které chceme převést do binárního zápisu.
|
|
2.
|
Provedeme celočíselné dělení čísla n dvěma, čímž získáme celočíselný podíl q a zbytek r, který je buď 0, nebo 1 (příklad: n = 9, 9 děleno 2 v celočíselném dělení je q = 4, zbytek je r = 1).
|
|
3.
|
Zapíšeme zbytek r. Jestliže jsme tento krok již prováděli, zapíšeme aktuální zbytek nalevo od předchozího.
|
|
4.
|
Jestliže q = 0, pokračujeme krokem 5. Jinak položíme n = q a přejdeme znovu na krok 2.
|
|
5.
|
Jestliže počet číslic dosud zapsaných při provádění kroku 3 je menší než 8, přidáme zleva tolik nul, abychom měli 8 číslic.
|
|
6.
|
V řádku osmi čtverečků znázorníme nuly jako prázdné čtverečky a jedničky jako plné čtverečky.
|
Jestliže provedeme tento algoritmus pro každé číslo z číselné definice neznámého PMG objektu a řádky 8 čtverečků řadíme pod sebe, vyplněné čtverečky vytvoří vzhled PMG objektu.
b) Vyhledání v tabulce
Pro číslo 0 až 255 můžeme nahradit kroky 1 až 5 ručního výpočtu vyhledáním binárního zápisu čísla v této tabulce.
Decimální |
Binární |
0 |
00000000 |
1 |
00000001 |
2 |
00000010 |
3 |
00000011 |
4 |
00000100 |
5 |
00000101 |
6 |
00000110 |
7 |
00000111 |
8 |
00001000 |
9 |
00001001 |
10 |
00001010 |
11 |
00001011 |
12 |
00001100 |
13 |
00001101 |
14 |
00001110 |
15 |
00001111 |
16 |
00010000 |
17 |
00010001 |
18 |
00010010 |
19 |
00010011 |
20 |
00010100 |
21 |
00010101 |
22 |
00010110 |
23 |
00010111 |
24 |
00011000 |
25 |
00011001 |
26 |
00011010 |
27 |
00011011 |
28 |
00011100 |
29 |
00011101 |
30 |
00011110 |
31 |
00011111 |
32 |
00100000 |
33 |
00100001 |
34 |
00100010 |
35 |
00100011 |
36 |
00100100 |
37 |
00100101 |
38 |
00100110 |
39 |
00100111 |
40 |
00101000 |
41 |
00101001 |
42 |
00101010 |
43 |
00101011 |
44 |
00101100 |
45 |
00101101 |
46 |
00101110 |
47 |
00101111 |
48 |
00110000 |
49 |
00110001 |
50 |
00110010 |
51 |
00110011 |
52 |
00110100 |
53 |
00110101 |
54 |
00110110 |
55 |
00110111 |
56 |
00111000 |
57 |
00111001 |
58 |
00111010 |
59 |
00111011 |
60 |
00111100 |
61 |
00111101 |
62 |
00111110 |
63 |
00111111 |
64 |
01000000 |
65 |
01000001 |
66 |
01000010 |
67 |
01000011 |
68 |
01000100 |
69 |
01000101 |
70 |
01000110 |
71 |
01000111 |
72 |
01001000 |
73 |
01001001 |
74 |
01001010 |
75 |
01001011 |
76 |
01001100 |
77 |
01001101 |
78 |
01001110 |
79 |
01001111 |
80 |
01010000 |
81 |
01010001 |
82 |
01010010 |
83 |
01010011 |
84 |
01010100 |
85 |
01010101 |
86 |
01010110 |
87 |
01010111 |
88 |
01011000 |
89 |
01011001 |
90 |
01011010 |
91 |
01011011 |
92 |
01011100 |
93 |
01011101 |
94 |
01011110 |
95 |
01011111 |
96 |
01100000 |
97 |
01100001 |
98 |
01100010 |
99 |
01100011 |
100 |
01100100 |
101 |
01100101 |
102 |
01100110 |
103 |
01100111 |
104 |
01101000 |
105 |
01101001 |
106 |
01101010 |
107 |
01101011 |
108 |
01101100 |
109 |
01101101 |
110 |
01101110 |
111 |
01101111 |
112 |
01110000 |
113 |
01110001 |
114 |
01110010 |
115 |
01110011 |
116 |
01110100 |
117 |
01110101 |
118 |
01110110 |
119 |
01110111 |
120 |
01111000 |
121 |
01111001 |
122 |
01111010 |
123 |
01111011 |
124 |
01111100 |
125 |
01111101 |
126 |
01111110 |
127 |
01111111 |
128 |
10000000 |
129 |
10000001 |
130 |
10000010 |
131 |
10000011 |
132 |
10000100 |
133 |
10000101 |
134 |
10000110 |
135 |
10000111 |
136 |
10001000 |
137 |
10001001 |
138 |
10001010 |
139 |
10001011 |
140 |
10001100 |
141 |
10001101 |
142 |
10001110 |
143 |
10001111 |
144 |
10010000 |
145 |
10010001 |
146 |
10010010 |
147 |
10010011 |
148 |
10010100 |
149 |
10010101 |
150 |
10010110 |
151 |
10010111 |
152 |
10011000 |
153 |
10011001 |
154 |
10011010 |
155 |
10011011 |
156 |
10011100 |
157 |
10011101 |
158 |
10011110 |
159 |
10011111 |
160 |
10100000 |
161 |
10100001 |
162 |
10100010 |
163 |
10100011 |
164 |
10100100 |
165 |
10100101 |
166 |
10100110 |
167 |
10100111 |
168 |
10101000 |
169 |
10101001 |
170 |
10101010 |
171 |
10101011 |
172 |
10101100 |
173 |
10101101 |
174 |
10101110 |
175 |
10101111 |
176 |
10110000 |
177 |
10110001 |
178 |
10110010 |
179 |
10110011 |
180 |
10110100 |
181 |
10110101 |
182 |
10110110 |
183 |
10110111 |
184 |
10111000 |
185 |
10111001 |
186 |
10111010 |
187 |
10111011 |
188 |
10111100 |
189 |
10111101 |
190 |
10111110 |
191 |
10111111 |
192 |
11000000 |
193 |
11000001 |
194 |
11000010 |
195 |
11000011 |
196 |
11000100 |
197 |
11000101 |
198 |
11000110 |
199 |
11000111 |
200 |
11001000 |
201 |
11001001 |
202 |
11001010 |
203 |
11001011 |
204 |
11001100 |
205 |
11001101 |
206 |
11001110 |
207 |
11001111 |
208 |
11010000 |
209 |
11010001 |
210 |
11010010 |
211 |
11010011 |
212 |
11010100 |
213 |
11010101 |
214 |
11010110 |
215 |
11010111 |
216 |
11011000 |
217 |
11011001 |
218 |
11011010 |
219 |
11011011 |
220 |
11011100 |
221 |
11011101 |
222 |
11011110 |
223 |
11011111 |
224 |
11100000 |
225 |
11100001 |
226 |
11100010 |
227 |
11100011 |
228 |
11100100 |
229 |
11100101 |
230 |
11100110 |
231 |
11100111 |
232 |
11101000 |
233 |
11101001 |
234 |
11101010 |
235 |
11101011 |
236 |
11101100 |
237 |
11101101 |
238 |
11101110 |
239 |
11101111 |
240 |
11110000 |
241 |
11110001 |
242 |
11110010 |
243 |
11110011 |
244 |
11110100 |
245 |
11110101 |
246 |
11110110 |
247 |
11110111 |
248 |
11111000 |
249 |
11111001 |
250 |
11111010 |
251 |
11111011 |
252 |
11111100 |
253 |
11111101 |
254 |
11111110 |
255 |
11111111 |
c) Pomocí Kalkulačky ve Windows (jestliže máme Windows)
Pomocí menu nebo stiskem Alt-3 přepneme do programátorského režimu. Nalevo vybereme „Dec“, „Word“. Vložíme decimální zápis čísla z číselné definice PMG objektu (0 až 255). Vezmeme posledních 8 binárních číslic zobrazených pod zadaným číslem. V řádku osmi čtverečků znázorníme nuly jako prázdné čtverečky a jedničky jako plné čtverečky. Po stisku klávesy „Delete“ můžeme zadat další číslo.
d) Pomocí tabulkového editoru
Rychlý způsob, jak se dá převést i větší počet čísel v desítkovém zápisu do binárního zápisu, je použít tabulkový editor (Microsoft Office Excel, OpenOffice.org Calc, LibreOffice Calc), který nám také pomůže převést nuly a jedničky na prázdné a vyplněné čtverečky.
Jestliže používáte Excel, je důležité vědět, že Excel v normálním zobrazení používá pro výšky řádků a šířky sloupců různé jednotky a v Excelu 2013 je třeba pro dosažení čtvercového tvaru buňky (viz níže krok 9) zadat jako šířku sloupce asi šestinu číselné hodnoty výšky řádku, ale Excel se dá přepnout do režimu „Rozložení stránky“ (Excel 2013: pozor, ne karta „Rozložení stránky“, ale karta „Zobrazení“, potom nalevo vybrat „Rozložení stránky“ místo výchozí volby „Normálně“) a potom jsou výška řádku i šířka sloupce ve stejných jednotkách.
|
1.
|
Vytvoříme nový prázdný tabulkový dokument.
|
|
2.
|
Vložíme čísla z číselné definice PMG objektu do sloupce A od buňky A1.
|
|
3.
|
Do buňky B1 vložíme tento vzorec:
=BASE(A1;2;8)
Při použití verze Excelu starší než Excel 2013 se může stát, že Excel funkci „BASE“ nezná. V tom případě v buňce B1 použijeme tento vzorec:
=DEC2BIN(A1;8)
|
|
4.
|
Do buňky C1 vložíme tento vzorec:
=IF(MID($B1;COLUMN()-2;1)="1";"█";" ")
Jestliže používáme český Excel, musíme použít ve vzorci česká klíčová slova:
=KDYŽ(ČÁST($B1;SLOUPEC()-2;1)="1";"█";" ")
|
|
5.
|
Vybereme buňku C1 a nastavíme u ní zarovnání na střed.
|
|
6.
|
Stiskneme Ctrl-C na buňce C1, vybereme buňky D1 až J1 a vložíme do nich vzorec stisknutím Ctrl-V.
|
|
7.
|
Klepneme pravým tlačítkem myši na záhlaví kteréhokoli řádku (nalevo), vybereme položku „Výška řádku“ a zapamatujeme si číslo zobrazené v dialogovém okně. Zavřeme dialogové okno beze změny čísla.
|
|
8.
|
Táhneme myší od záhlaví sloupce C po záhlaví sloupce J.
|
|
9.
|
Klepneme pravým tlačítkem myši na záhlaví kteréhokoli z vybraných sloupců, vybereme položku „Šířka sloupce“, vložíme číslo, které jsme předtím viděli v dialogovém okně „Výška řádku“, a potvrdíme. Buňky ve sloupcích C až J by nyní měly být čtvercové.
|
|
10.
|
Vybereme buňky B1 až J1 a stiskneme Ctrl-C.
|
|
11.
|
Vybereme buňky B2 až J2, rozšíříme výběr směrem dolů až po řádek s posledním číslem ve sloupci A a stiskneme Ctrl-V.
|
Nyní vidíme vzhled PMG objektu ve sloupcích C až J. Na obrázku 3 vidíme výsledek těchto kroků pro číselnou definici 60, 126, 219, 255, 189, 195, 126, 60.
Obrázek 3: Získání vzhledu PMG objektu z jeho číselné definice pomocí tabulkového editoru
Můžeme také využít tabulkový editor k vygenerování HTML kódu, který zobrazí vzhled PMG objektu. Toto nám může pomoci, když chceme získat hezčí zobrazení vzhledu PMG objektu nebo když se nám nedaří nastavit šířky sloupců v Excelu. Následující vzorec je navržený tak, aby se dal vložit buď do sloupců C až J místo předchozího vzorce, nebo do sloupců K až R vedle předchozího vzorce. Vzorec má být vložen do těchto sloupců ve všech řádcích, kde je ve sloupci A číslo z číselné definice PMG objektu.
=CONCATENATE(IF(OR(COLUMN()=3;COLUMN()=11);" <tr style=""height:25px;"">";"");"<td style=""background:#";IF(MID($B1;COLUMN()-IF(COLUMN()<=10;2;10);1)="1";"FF00FF";"FFFFFF");";""> </td>";IF(OR(COLUMN()=10;COLUMN()=18);CONCATENATE("<td style=""text-align:right; background:#C0C0C0;""> ";$A1;" </td></tr>");""))
Pro český Excel vzorec vypadá takto:
=CONCATENATE(KDYŽ(NEBO(SLOUPEC()=3;SLOUPEC()=11);" <tr style=""height:25px;"">";"");"<td style=""background:#";KDYŽ(ČÁST($B1;SLOUPEC()-KDYŽ(SLOUPEC()<=10;2;10);1)="1";"FF00FF";"FFFFFF");";""> </td>";KDYŽ(NEBO(SLOUPEC()=10;SLOUPEC()=18);CONCATENATE("<td style=""text-align:right; background:#C0C0C0;""> ";$A1;" </td></tr>");""))
Po vložení vzorce do všech 8 sloupců (C až J nebo K až R) a do všech řádků vybereme všechny buňky, do kterých jsme vzorec vložili, a stiskneme Ctrl-C. V nějakém textovém editoru pro prostý (neformátovaný) text vytvoříme nový soubor a vložíme do něj obsah schránky stisknutím Ctrl-V. Přesuneme se na začátek a před tento obsah vložíme kód:
<table border="1" cellspacing="0" cellpadding="0" style="font-size:10pt; font-family:sans-serif;">
<tr style="height:25px; background:#C0C0C0; text-align:center;"><td style="width:25px;">128</td><td style="width:25px;">64</td><td style="width:25px;">32</td><td style="width:25px;">16</td><td style="width:25px;">8</td><td style="width:25px;">4</td><td style="width:25px;">2</td><td style="width:25px;">1</td><td> </td></tr>
Přesuneme se na konec a za tento obsah vložíme kód:
</table>
Uložíme tento soubor tak, aby měl příponu „.htm“, například pod názvem „PMG.htm“. Otevřeme tento soubor ve webovém prohlížeči a zobrazí se vzhled PMG objektu jako na obrázku 4, kde vidíme výsledek pro číselnou definici 60, 126, 219, 255, 189, 195, 126, 60.
Obrázek 4: Získání vzhledu PMG objektu z jeho číselné definice generováním HTML kódu v tabulkovém editoru
K získání 15 číslic finálních souřadnic kešky N ??° ??.??? E ???° ??.??? potřebujete zjistit, jak by vypadal PMG objekt takový, že jeho číselná definice je tvořena těmito čísly:
0 |
126 |
96 |
124 |
6 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
12 |
28 |
60 |
108 |
126 |
12 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
60 |
102 |
60 |
102 |
102 |
60 |
0 |
0 |
60 |
96 |
124 |
102 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
24 |
56 |
24 |
24 |
24 |
126 |
0 |
0 |
12 |
28 |
60 |
108 |
126 |
12 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
Bonus – Albatros
Na kešce najdete bonusové číslo (něco přes 1,2 · 109). Toto číslo je napsané v decimálním zápisu, v desítkové číselné soustavě. Možná znáte šestnáctkovou (hexadecimální) číselnou soustavu, která používá 16 symbolů, kromě číslic 0 až 9 používá písmena A až F. Hodnoty písmen A až F jsou 10 až 15. Můžeme však uvažovat i o číselné soustavě o základu 36, která používá číslice 0 až 9 a všech 26 písmen anglické abecedy A až Z s hodnotami 10 až 35. Když převedete bonusové číslo do soustavy o základu 36 (například pomocí výše uvedené funkce „BASE“ v tabulkových editorech), získáte něco, co můžete objevit.
Player-Missile Graphics |
EN |
This mystery cache is located on a municipal land managed by the municipal part Praha-Štěrboholy. In order to comply with the geocaching rule saying that I must have the landowner’s or land manager’s permission prior to hiding a cache, I consulted the placement of the cache with the mayor of the municipal part Praha-Štěrboholy. I thank the mayor for the permission to place the cache on this land.
The listing is long, but do not be afraid of it, you will certainly be able to solve the final coordinates.
The initial coordinates point to the bus stop from where it is possible to walk to the final coordinates. The bus stop is not the place where the cache is hidden.
I recommend displaying this listing on a computer in a web browser, not only in a mobile application, because it will be useful to have the possibility to copy a part of the listing to another application.
I recommend you to have your own writing tool for logging in the logbook, a sharpened pencil is not guaranteed to be always available. Please, save space in the logbook.
In the 1980s, some of us already had a computer, but the computers of that period were very different from today’s ones. I had a microcomputer Atari 800 XE, which had a built-in programming language Atari Basic, 64 kilobytes of memory, an eight-bit processor 6502 with a frequency of 1.79 MHz, an ANTIC graphical chip, a POKEY keyboard and sound chip, 4 sound channels, was able to display at most 128 colours, in the default text mode it was able to display at most 24 lines of 40 characters, used audio cassettes or 5.25-inch floppy disks for storing data, had no mouse, was controlled with the keyboard and one or two joysticks and usually displayed its visual output on a TV set. The keyboard, processor, other chips and memory constituted together a single device.
The Atari microcomputers have a special technology named “Player-Missile Graphics” (PMG), designed mainly for games. With this technology it is possible to display up to four player objects and four missiles or 5 players without missiles. Each of the objects may have a different colour. The objects may move across the screen independently of other content displayed on the screen. Is is possible to define whether these PMG objects are to be displayed in front of, or behind other objects displayed on the screen (display priority). It is possible to detect collisions of PMG objects, which is important for games, where we need to know when a player is hit by a missile, collides with an enemy or touches an object to collect.
A PMG player object has a width limited to 8 pixels. Its height may spread over the whole height of the screen. Therefore it must fit in a column 8 pixels wide. Moving the PMG object horizontally is simple, it is done by setting the horizontal position of the column. To move the object vertically, it is necessary to move the object numeric definition within the memory section from which the column containing the object is displayed.
I will not describe the entire process of setting up the display of PMG objects, but I will describe the design of a PMG player object and the conversion between its appearance and its numeric definition, which is the format in which the object must be stored in the memory. To design a PMG player object, we need an 8-column square grid, in which we draw the object by filling some of the squares. Figure 1 shows an example PMG object.
Figure 1: An example PMG object
Then we need to calculate the numeric definition of the object. Each row of 8 pixels is described by one eight-bit number (0 to 255). By replacing empty squares in the row by zeros and filled squares by ones, we get the eight-digit binary notation of the number that we need to obtain. To obtain these numbers in their decimal notation, we write powers of the number two (1, 2, 4, 8, 16, 32, 64, 128) above the columns from the right to the left. Then for each row we calculate the sum of the numbers written above all the columns in which the square in the given row is filled. Figure 2 shows the calculation of the numeric definition of the object from figure 1.
Figure 2: Calculation of the numeric definition of the PMG object from figure 1
Now we know that the numeric definition of the PMG object from figure 1 consists of the numbers 60, 126, 219, 255, 189, 195, 126, 60. The number of numbers forming the numeric definition of the PMG object corresponds to the number of rows occupied by this object.
Apart from the design of a PMG object, the same process is used also for designing characters for a character set, but for characters also the height is limited to 8 pixels.
What if, on the other hand, we only have the numeric definition of an unknown PMG object, we do not know what it looks like and we want to find its appearance? We must do what an Atari computer would do with its numeric definition. We need to convert each of the eight-bit numbers of the numeric definition to its eight-digit binary notation. There are several ways to do this.
a) Manual calculation
|
1.
|
Let n be the number to convert to its binary notation.
|
|
2.
|
Perform a whole-number division of the number n by two, so that you obtain the integer quotient q and the remainder r, which is either 0, or 1 (example: n = 9, 9 divided by 2 in whole-number division is q = 4, the remainder is r = 1).
|
|
3.
|
Write down the remainder r. If you have already done this step before, write the current remainder to the left of the previous one.
|
|
4.
|
If q = 0, continue with step 5. Otherwise, set n = q and go back to step 2.
|
|
5.
|
If the number of digits written down in step 3 until now is less than 8, add as many zeros to the left of these digits as necessary to have 8 digits.
|
|
6.
|
In a row of eight squares, visualize zeros as empty squares and ones as filled squares.
|
If this algorithm is performed for each number of the numeric definition of the unknown PMG object and rows of 8 squares are added one below another, the filled squares will form the appearance of the PMG object.
b) Looking up in the table
For a number 0 to 255 we can replace the steps 1 to 5 of the manual calculation by looking up the binary notation of the number in this table.
Decimal |
Binary |
0 |
00000000 |
1 |
00000001 |
2 |
00000010 |
3 |
00000011 |
4 |
00000100 |
5 |
00000101 |
6 |
00000110 |
7 |
00000111 |
8 |
00001000 |
9 |
00001001 |
10 |
00001010 |
11 |
00001011 |
12 |
00001100 |
13 |
00001101 |
14 |
00001110 |
15 |
00001111 |
16 |
00010000 |
17 |
00010001 |
18 |
00010010 |
19 |
00010011 |
20 |
00010100 |
21 |
00010101 |
22 |
00010110 |
23 |
00010111 |
24 |
00011000 |
25 |
00011001 |
26 |
00011010 |
27 |
00011011 |
28 |
00011100 |
29 |
00011101 |
30 |
00011110 |
31 |
00011111 |
32 |
00100000 |
33 |
00100001 |
34 |
00100010 |
35 |
00100011 |
36 |
00100100 |
37 |
00100101 |
38 |
00100110 |
39 |
00100111 |
40 |
00101000 |
41 |
00101001 |
42 |
00101010 |
43 |
00101011 |
44 |
00101100 |
45 |
00101101 |
46 |
00101110 |
47 |
00101111 |
48 |
00110000 |
49 |
00110001 |
50 |
00110010 |
51 |
00110011 |
52 |
00110100 |
53 |
00110101 |
54 |
00110110 |
55 |
00110111 |
56 |
00111000 |
57 |
00111001 |
58 |
00111010 |
59 |
00111011 |
60 |
00111100 |
61 |
00111101 |
62 |
00111110 |
63 |
00111111 |
64 |
01000000 |
65 |
01000001 |
66 |
01000010 |
67 |
01000011 |
68 |
01000100 |
69 |
01000101 |
70 |
01000110 |
71 |
01000111 |
72 |
01001000 |
73 |
01001001 |
74 |
01001010 |
75 |
01001011 |
76 |
01001100 |
77 |
01001101 |
78 |
01001110 |
79 |
01001111 |
80 |
01010000 |
81 |
01010001 |
82 |
01010010 |
83 |
01010011 |
84 |
01010100 |
85 |
01010101 |
86 |
01010110 |
87 |
01010111 |
88 |
01011000 |
89 |
01011001 |
90 |
01011010 |
91 |
01011011 |
92 |
01011100 |
93 |
01011101 |
94 |
01011110 |
95 |
01011111 |
96 |
01100000 |
97 |
01100001 |
98 |
01100010 |
99 |
01100011 |
100 |
01100100 |
101 |
01100101 |
102 |
01100110 |
103 |
01100111 |
104 |
01101000 |
105 |
01101001 |
106 |
01101010 |
107 |
01101011 |
108 |
01101100 |
109 |
01101101 |
110 |
01101110 |
111 |
01101111 |
112 |
01110000 |
113 |
01110001 |
114 |
01110010 |
115 |
01110011 |
116 |
01110100 |
117 |
01110101 |
118 |
01110110 |
119 |
01110111 |
120 |
01111000 |
121 |
01111001 |
122 |
01111010 |
123 |
01111011 |
124 |
01111100 |
125 |
01111101 |
126 |
01111110 |
127 |
01111111 |
128 |
10000000 |
129 |
10000001 |
130 |
10000010 |
131 |
10000011 |
132 |
10000100 |
133 |
10000101 |
134 |
10000110 |
135 |
10000111 |
136 |
10001000 |
137 |
10001001 |
138 |
10001010 |
139 |
10001011 |
140 |
10001100 |
141 |
10001101 |
142 |
10001110 |
143 |
10001111 |
144 |
10010000 |
145 |
10010001 |
146 |
10010010 |
147 |
10010011 |
148 |
10010100 |
149 |
10010101 |
150 |
10010110 |
151 |
10010111 |
152 |
10011000 |
153 |
10011001 |
154 |
10011010 |
155 |
10011011 |
156 |
10011100 |
157 |
10011101 |
158 |
10011110 |
159 |
10011111 |
160 |
10100000 |
161 |
10100001 |
162 |
10100010 |
163 |
10100011 |
164 |
10100100 |
165 |
10100101 |
166 |
10100110 |
167 |
10100111 |
168 |
10101000 |
169 |
10101001 |
170 |
10101010 |
171 |
10101011 |
172 |
10101100 |
173 |
10101101 |
174 |
10101110 |
175 |
10101111 |
176 |
10110000 |
177 |
10110001 |
178 |
10110010 |
179 |
10110011 |
180 |
10110100 |
181 |
10110101 |
182 |
10110110 |
183 |
10110111 |
184 |
10111000 |
185 |
10111001 |
186 |
10111010 |
187 |
10111011 |
188 |
10111100 |
189 |
10111101 |
190 |
10111110 |
191 |
10111111 |
192 |
11000000 |
193 |
11000001 |
194 |
11000010 |
195 |
11000011 |
196 |
11000100 |
197 |
11000101 |
198 |
11000110 |
199 |
11000111 |
200 |
11001000 |
201 |
11001001 |
202 |
11001010 |
203 |
11001011 |
204 |
11001100 |
205 |
11001101 |
206 |
11001110 |
207 |
11001111 |
208 |
11010000 |
209 |
11010001 |
210 |
11010010 |
211 |
11010011 |
212 |
11010100 |
213 |
11010101 |
214 |
11010110 |
215 |
11010111 |
216 |
11011000 |
217 |
11011001 |
218 |
11011010 |
219 |
11011011 |
220 |
11011100 |
221 |
11011101 |
222 |
11011110 |
223 |
11011111 |
224 |
11100000 |
225 |
11100001 |
226 |
11100010 |
227 |
11100011 |
228 |
11100100 |
229 |
11100101 |
230 |
11100110 |
231 |
11100111 |
232 |
11101000 |
233 |
11101001 |
234 |
11101010 |
235 |
11101011 |
236 |
11101100 |
237 |
11101101 |
238 |
11101110 |
239 |
11101111 |
240 |
11110000 |
241 |
11110001 |
242 |
11110010 |
243 |
11110011 |
244 |
11110100 |
245 |
11110101 |
246 |
11110110 |
247 |
11110111 |
248 |
11111000 |
249 |
11111001 |
250 |
11111010 |
251 |
11111011 |
252 |
11111100 |
253 |
11111101 |
254 |
11111110 |
255 |
11111111 |
c) Using the Windows Calculator (if we have Windows)
Use the menu or press Alt-3 to switch to the Programmer mode. On the left select “Dec”, “Word”. Type the decimal notation of a number from the numeric definition of the PMG object (0 to 255). Take the last 8 binary digits displayed below the number that you typed. In a row of eight squares, visualize zeros as empty squares and ones as filled squares. Press the “Delete” key to start entering another number.
d) Using a spreadsheet editor
A fast way to convert even a large number of decimal numbers to binary notation is to use a spreadsheet editor (Microsoft Office Excel, OpenOffice.org Calc, LibreOffice Calc), which will also help us convert zeros and ones to empty and filled squares.
If you use Excel, it is important to know that in the normal view Excel uses different units for row height and column width and in Excel 2013 to achieve the square shape of a cell (see below step 9) it is necessary to set the column width to about one sixth of the numeric value of the row height, but Excel can be switched to the “Page Layout” mode (Excel 2013: attention, not the card “Page Layout”, but the card “View”, then on the left select “Page Layout” instead of the default option “Normal”) and then both the row height and the column width are in the same units.
|
1.
|
Create a new empty spreadsheet.
|
|
2.
|
Insert the numbers of the numeric definition of the PMG object into column A from cell A1.
|
|
3.
|
In cell B1, insert this formula:
=BASE(A1;2;8)
When using a version of Excel older than Excel 2013, it may happen that Excel does not know the “BASE” function. In that case use this formula in cell B1:
=DEC2BIN(A1;8)
|
|
4.
|
In cell C1, insert this formula:
=IF(MID($B1;COLUMN()-2;1)="1";"█";" ")
|
|
5.
|
Select cell C1 and set its horizontal alignment to “Center”.
|
|
6.
|
Press Ctrl-C on cell C1, select cells D1 to J1 and paste the formula into them by pressing Ctrl-V.
|
|
7.
|
Right-click the header of any row (on the left), select the “Row height” item and remember the number displayed in the dialog box. Close the dialog box without changing the number.
|
|
8.
|
Drag the mouse from the header of column C to the header of column J.
|
|
9.
|
Right-click the header of any of the selected columns, select the “Column width” item, enter the number that you saw before in the “Row height” dialog box and confirm. The cells in the columns C to J should now be square.
|
|
10.
|
Select cells B1 to J1 and press Ctrl-C.
|
|
11.
|
Select cells B2 to J2, extend the selection downwards to the row with the last number in column A and press Ctrl-V.
|
Now we see the appearance of the PMG object in columns C to J. In figure 3 we can see the result of these steps for the numeric definition 60, 126, 219, 255, 189, 195, 126, 60.
Figure 3: Obtaining the appearance of a PMG object from its numeric definition using a spreadsheet editor
We can also use the spreadsheet editor for generating HTML code that will display the appearance of the PMG object. This may help us if we want to obtain a nicer display of the appearance of the PMG object or if we do not manage to set the column widths in Excel. The following formula is designed so that we can place it either in the columns C to J instead of the previous formula, or in the columns K to R next to the previous formula. The formula is to be inserted into these columns in all the rows where there is a number from the numeric definition of the PMG object in column A.
=CONCATENATE(IF(OR(COLUMN()=3;COLUMN()=11);" <tr style=""height:25px;"">";"");"<td style=""background:#";IF(MID($B1;COLUMN()-IF(COLUMN()<=10;2;10);1)="1";"FF00FF";"FFFFFF");";""> </td>";IF(OR(COLUMN()=10;COLUMN()=18);CONCATENATE("<td style=""text-align:right; background:#C0C0C0;""> ";$A1;" </td></tr>");""))
After inserting the formula info all the 8 columns (C to J or K to R) and into all the rows, select all the cells into which the formula has been inserted, and press Ctrl-C. In a text editor for plain (unformatted) text, create a new file and insert into it the content of the clipboard by pressing Ctrl-V. Move to the beginning and before the content insert the code:
<table border="1" cellspacing="0" cellpadding="0" style="font-size:10pt; font-family:sans-serif;">
<tr style="height:25px; background:#C0C0C0; text-align:center;"><td style="width:25px;">128</td><td style="width:25px;">64</td><td style="width:25px;">32</td><td style="width:25px;">16</td><td style="width:25px;">8</td><td style="width:25px;">4</td><td style="width:25px;">2</td><td style="width:25px;">1</td><td> </td></tr>
Move to the end and after the content insert the code:
</table>
Save the file so that it has the extension “.htm”, for example with the name “PMG.htm”. Open this file in a web browser and the appearance of the PMG object will be displayed like in figure 4, where we can see the result for the numeric definition 60, 126, 219, 255, 189, 195, 126, 60.
Figure 4: Obtaining the appearance of a PMG object from its numeric definition by generating HTML code in a spreadsheet editor
To find the 15 digits of the final coordinates of the cache N ??° ??.??? E ???° ??.???, you need to find the appearance of such a PMG object that its numeric definition consists of these numbers:
0 |
126 |
96 |
124 |
6 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
12 |
28 |
60 |
108 |
126 |
12 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
60 |
102 |
60 |
102 |
102 |
60 |
0 |
0 |
60 |
96 |
124 |
102 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
24 |
56 |
24 |
24 |
24 |
126 |
0 |
0 |
12 |
28 |
60 |
108 |
126 |
12 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
60 |
102 |
110 |
118 |
102 |
60 |
0 |
0 |
126 |
12 |
24 |
12 |
102 |
60 |
0 |
Bonus – Albatros
You will find a bonus number (a bit more that 1.2 · 109) on the cache. This number is written in the decimal notation, in the 10‑based number system. Maybe you know the hexadecimal number system, which uses 16 symbols, apart from the digits 0 to 9 it uses the letters A to F. The values of the letters A to F are 10 to 15. However, we can also consider the 36‑based number system, which uses the digits 0 to 9 and all the 26 letters of the English alphabet A to Z with the values 10 to 35. If you convert the bonus number to the 36‑based number system (for example by means of the “BASE” function in spreadsheet editors mentioned above), you will obtain something that you can discover.