Repository navigation
Expand file tree
/
Copy pathCompression.rtf
More file actions
64 lines (55 loc) · 3.04 KB
/
Copy pathCompression.rtf
File metadata and controls
64 lines (55 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\colortbl ;\red255\green255\blue0;\red0\green255\blue0;\red255\green0\blue255;\red0\green255\blue255;\red255\green0\blue0;\red255\green255\blue255;\red128\green128\blue0;\red0\green0\blue255;}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang16\par
\pard\sl276\slmult1\fs32 EXAMPLE COMPRESSED STATE STRING:\par
\fs22 [ \highlight1 2nkWY1Qg\highlight0 [ \highlight2 GbAoChgAYQBgAAZmZQADMAJEVTMAAgBEUREQIg\par
\highlight0\par
\highlight1\fs28 NEXT QUEUE\highlight0 :\par
\fs22 1) decode from Base64 to Binary\par
\par
\pard\sl276\slmult1\qc 2nkWY1Qg\par
\\/\par
\highlight3 DA 79\highlight0 \highlight4 16 63 54 20\par
\pard\sl276\slmult1\par
\highlight0 First 2 Bytes are the Bag Seeed.\par
All the other half-bytes are the the HOLD and the NEXT QUEUE, piece IDs\par
in this case: \par
\par
\pard\sl276\slmult1\qc 1 6 6 3 5 4 2 0\par
\\/\par
\highlight4 J T T O L Z S I\par
\pard\sl276\slmult1\highlight0\par
The half-byte '0xF' is -1 and corresponds to 'empty'\par
The half-byte '0xE' is padding and it should be ignored.\par
\par
\highlight2\fs28 TETRIS BOARD:\par
\highlight0\fs22 1) decode from Base64 to Binary\par
\par
\pard\sl276\slmult1\qc GbAoChgAYQBgAAZmZQADMAJEVTMAAgBEUREQIg\par
\\/\par
\highlight4 19 B0 28 0A 18 00 61 00 60 00 06 66 65 00 03 30 02 44 55 33 00 02 00 44 51 11 10 22\par
\par
\pard\sl276\slmult1\highlight0 This is compressed data using the Win32 compression algorithm: LZNT\par
2) decompress into Binary\par
\highlight4\par
\pard\sl276\slmult1\qc\highlight0 19 B0 28 0A 18 00 61 00 60 00 06 66 65 00 03 30 02 44 55 33 00 02 00 44 51 11 10 22\par
\\/\par
\highlight5 0A 18\highlight0 \highlight4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 00 00 00 66 65 03 30 02 44 55 33 00 02 44 51 11 10 22\par
\pard\sl276\slmult1\par
\highlight0 First 2 Bytes are respectively \highlight5 GRID_X\highlight0 and \highlight5 GRID_Y\highlight0 (the sizes of the field)\par
All the subsequent half bytes represent the individual color for each block of the grid.\par
\par
\par
0 0 0 0 0 0 0 0 0 0\par
0 0 0 0 0 0 0 0 0 0\par
...\par
0 0 0 0 0 0 0 0 0 0\par
0 0 0 0 0 0 0 0 0 0\par
0 0 \cf6\highlight7 6 \cf0\highlight0 0 0 0 0 0 0 0\par
\cf6\highlight7 6 6 6 \cf0\highlight5 5 \highlight0 0 \highlight2 3 3 \highlight0 0 0 \cf6\highlight8 2 \cf0\highlight0\par
\highlight1 4 4 \highlight5 5 5 \highlight2 3 3 \highlight0 0 0 0 \cf6\highlight8 2 \cf0\highlight0\par
\highlight1 4 4 \highlight5 5 \highlight4 1 1 1 1 \highlight0 0 \cf6\highlight8 2 2 \cf0\highlight1\par
\highlight0\par
}