commit c9e2acd
0uppy
·
2026-09-09 18:02:46 +0000 UTC
parent b5586b1
cotton - cleaned some stuff i wont need moving forward for the new cot and cotton
7 files changed,
+0,
-1087
+0,
-17
1@@ -1,17 +0,0 @@
2-.Dd July 2026
3-.Dt EIKI 5
4-.Os cotton 0.2
5-.Sh NAME
6-.Nm eiki
7-.Nd the bitmap font for cotton
8-
9-.Sh DESCRIPTION
10-
11-eiki is the custom 6x8 bitmap font used by cotton(1) for text rendering.
12-
13-there isn't a whole lot to say here ermmm,..,
14-
15-.Sh SEE ALSO
16-.Xr cotton 1 ,
17-.Xr cot 5 ,
18-.Xr eikimaker 1
+0,
-23
1@@ -1,23 +0,0 @@
2-.Dd July 2026
3-.Dt EIKIMAKER 1
4-.Os cotton 0.2
5-.Sh NAME
6-.Nm eikimaker
7-.Nd the Eiki font character generator utility for cotton
8-
9-.Sh SYNOPSIS
10-.Nm ./eikimaker
11-
12-.Sh DESCRIPTION
13-
14-eikimaker is an interactive CLI utility written in Go that generates custom 6x8 pixel bitmap font
15-characters for the cotton(1) ecosystem - despite the name, i incentivate anyone who may want to
16-make their own font to use eikimaker as a means to do so!!
17-
18-when used, eikimaker prompts the user for a target character and then proceduraly displays an 8 row grid as the user draws their character
19-- when done, it then packs each row into a byte representation and it sends the result directly into an eikis.txt file.
20-
21-.Sh SEE ALSO
22-.Xr cotton 1 ,
23-.Xr cot 5 ,
24-.Xr eiki 5
+0,
-78
1@@ -1,78 +0,0 @@
2-#include "cottonwindow.h"
3-#include <stdio.h>
4-
5-int
6-cottonwindow_init (CottonWindow *cw, const char *title, int window_w, int window_h, int texture_w, int texture_h)
7-{
8-
9- if (SDL_Init(SDL_INIT_VIDEO) != 0) {
10- fprintf(stderr, "cotton couldn't start SDL :( : %s\n", SDL_GetError());
11- return 0;
12- }
13-
14- cw->window = SDL_CreateWindow(title, 0, 0, window_w, window_h, SDL_WINDOW_SHOWN);
15-
16- if (!cw->window) {
17- fprintf(stderr, "cotton couldn't create a window :( : %s\n", SDL_GetError());
18- return 0;
19- }
20-
21- cw->renderer = SDL_CreateRenderer(cw->window, -1, 0);
22- if (!cw->renderer) {
23- fprintf(stderr, "cotton couldn't render this :( : %s\n", SDL_GetError());
24- return 0;
25- }
26-
27- cw->texture =
28- SDL_CreateTexture(cw->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, texture_w, texture_h);
29- if (!cw->texture) {
30- fprintf(stderr, "cotton couldn't apply textures :( : %s\n", SDL_GetError());
31- return 0;
32- }
33-
34- return 1;
35-}
36-
37-void
38-cottonwindow_update(CottonWindow *cw, const void *buffer, int pitch)
39-{
40- SDL_UpdateTexture(cw->texture, NULL, buffer, pitch);
41- SDL_RenderClear(cw->renderer);
42- SDL_RenderCopy(cw->renderer, cw->texture, NULL, NULL);
43- SDL_RenderPresent(cw->renderer);
44-}
45-
46-int cottonwindow_process_input
47-(CottonWindow *cw, uint8_t *keys)
48-{
49- (void)cw;
50- (void)keys;
51- int quit = 0;
52- SDL_Event event;
53-
54- while (SDL_PollEvent(&event)) {
55- switch (event.type) {
56- case SDL_QUIT: {
57- quit = 1;
58- break;
59- }
60-
61- case SDL_KEYDOWN: {
62- if (event.key.keysym.sym == SDLK_ESCAPE)
63- quit = 1;
64- break;
65- }
66- }
67- }
68-
69- return quit;
70-}
71-
72-void cottonwindow_destroy
73-(CottonWindow *cw)
74-{
75- SDL_DestroyTexture(cw->texture);
76- SDL_DestroyRenderer(cw->renderer);
77- SDL_DestroyWindow(cw->window);
78- SDL_Quit();
79-}
+0,
-24
1@@ -1,24 +0,0 @@
2-#ifndef COTTONWINDOW_H
3-#define COTTONWINDOW_H
4-
5-#include <SDL.h>
6-#include <stdint.h>
7-
8-typedef struct
9-{
10- SDL_Window *window;
11- SDL_Renderer *renderer;
12- SDL_Texture *texture;
13-
14-} CottonWindow;
15-
16-int cottonwindow_init
17-(CottonWindow *cw, const char *title, int window_w, int window_h, int texture_w, int texture_h);
18-void cottonwindow_update
19-(CottonWindow *cw, const void *buffer, int pitch);
20-int cottonwindow_process_input
21-(CottonWindow *cw, uint8_t *keys);
22-void cottonwindow_destroy
23-(CottonWindow *cw);
24-
25-#endif
+0,
-830
1@@ -1,830 +0,0 @@
2-#ifndef EIKI_H
3-#define EIKI_H
4-
5-#include <stdint.h>
6-
7-#define FONT_WIDTH 6
8-#define FONT_HEIGHT 8
9-
10-static const uint8_t
11-EIKI_FONT[256][FONT_HEIGHT] = {
12-
13- [' '] =
14- {
15- 0b00000000,
16- 0b00000000,
17- 0b00000000,
18- 0b00000000,
19- 0b00000000,
20- 0b00000000,
21- 0b00000000,
22- 0b00000000,
23- },
24-
25- ['A'] =
26- {
27- 0b00000000,
28- 0b00011110,
29- 0b00100001,
30- 0b00100001,
31- 0b00111111,
32- 0b00100001,
33- 0b00110011,
34- 0b00000000,
35- },
36-
37- ['B'] =
38- {
39- 0b00000000,
40- 0b00011110,
41- 0b00100010,
42- 0b00011110,
43- 0b00100010,
44- 0b00100010,
45- 0b00011110,
46- 0b00000000,
47- },
48-
49- ['C'] =
50- {
51- 0b00000000,
52- 0b00011110,
53- 0b00100001,
54- 0b00000001,
55- 0b00000001,
56- 0b00100001,
57- 0b00011110,
58- 0b00000000,
59- },
60-
61- ['D'] =
62- {
63- 0b00000000,
64- 0b00011110,
65- 0b00100010,
66- 0b00100010,
67- 0b00100010,
68- 0b00010010,
69- 0b00001110,
70- 0b00000000,
71- },
72-
73- ['E'] =
74- {
75- 0b00000000,
76- 0b00011111,
77- 0b00000001,
78- 0b00000111,
79- 0b00000001,
80- 0b00000001,
81- 0b00011111,
82- 0b00000000,
83- },
84-
85- ['F'] =
86- {
87- 0b00000000,
88- 0b00011111,
89- 0b00000001,
90- 0b00000111,
91- 0b00000001,
92- 0b00000001,
93- 0b00000001,
94- 0b00000000,
95- },
96-
97- ['G'] =
98- {
99- 0b00000000,
100- 0b00011110,
101- 0b00010001,
102- 0b00000001,
103- 0b00011001,
104- 0b00010001,
105- 0b00001110,
106- 0b00000000,
107- },
108-
109- ['H'] =
110- {
111- 0b00000000,
112- 0b00010010,
113- 0b00010010,
114- 0b00011110,
115- 0b00010010,
116- 0b00010010,
117- 0b00010010,
118- 0b00000000,
119- },
120-
121- ['I'] =
122- {
123- 0b00000000,
124- 0b00001110,
125- 0b00000100,
126- 0b00000100,
127- 0b00000100,
128- 0b00000100,
129- 0b00001110,
130- 0b00000000,
131- },
132-
133- ['J'] =
134- {
135- 0b00000000,
136- 0b00011100,
137- 0b00001000,
138- 0b00001000,
139- 0b00001000,
140- 0b00001001,
141- 0b00000111,
142- 0b00000000,
143- },
144-
145- ['K'] =
146- {
147- 0b00000000,
148- 0b00010010,
149- 0b00010010,
150- 0b00001010,
151- 0b00000110,
152- 0b00001010,
153- 0b00010010,
154- 0b00000000,
155- },
156-
157- ['L'] =
158- {
159- 0b00000000,
160- 0b00000100,
161- 0b00000100,
162- 0b00000100,
163- 0b00000100,
164- 0b00100100,
165- 0b00111100,
166- 0b00000000,
167- },
168-
169- ['M'] =
170- {
171- 0b00000000,
172- 0b00100001,
173- 0b00110011,
174- 0b00101101,
175- 0b00100001,
176- 0b00100001,
177- 0b00100001,
178- 0b00000000,
179- },
180-
181- ['N'] =
182- {
183- 0b00000000,
184- 0b00010010,
185- 0b00010110,
186- 0b00011010,
187- 0b00010010,
188- 0b00010010,
189- 0b00010010,
190- 0b00000000,
191- },
192-
193- ['O'] =
194- {
195- 0b00000000,
196- 0b00011110,
197- 0b00100001,
198- 0b00100001,
199- 0b00100001,
200- 0b00100001,
201- 0b00011110,
202- 0b00000000,
203- },
204-
205- ['P'] =
206- {
207- 0b00000000,
208- 0b00011111,
209- 0b00100001,
210- 0b00100001,
211- 0b00011111,
212- 0b00000001,
213- 0b00000001,
214- 0b00000000,
215- },
216-
217- ['Q'] =
218- {
219- 0b00000000,
220- 0b00011110,
221- 0b00100001,
222- 0b00100001,
223- 0b00101001,
224- 0b00110001,
225- 0b00011110,
226- 0b00000000,
227- },
228-
229- ['R'] =
230- {
231- 0b00000000,
232- 0b00011110,
233- 0b00100010,
234- 0b00100010,
235- 0b00011110,
236- 0b00100010,
237- 0b00100010,
238- 0b00000000,
239- },
240-
241- ['S'] =
242- {
243- 0b00000000,
244- 0b00001110,
245- 0b00010001,
246- 0b00000110,
247- 0b00001000,
248- 0b00010001,
249- 0b00001110,
250- 0b00000000,
251- },
252-
253- ['T'] =
254- {
255- 0b00000000,
256- 0b00111111,
257- 0b00000100,
258- 0b00000100,
259- 0b00000100,
260- 0b00000100,
261- 0b00001110,
262- 0b00000000,
263- },
264-
265- ['U'] =
266- {
267- 0b00000000,
268- 0b00100001,
269- 0b00100001,
270- 0b00100001,
271- 0b00100001,
272- 0b00100001,
273- 0b00011110,
274- 0b00000000,
275- },
276-
277- ['V'] =
278- {
279- 0b00000000,
280- 0b00100001,
281- 0b00100001,
282- 0b00010010,
283- 0b00010010,
284- 0b00001100,
285- 0b00000100,
286- 0b00000000,
287- },
288-
289- ['W'] =
290- {
291- 0b00000000,
292- 0b00100001,
293- 0b00100001,
294- 0b00100001,
295- 0b00101101,
296- 0b00110011,
297- 0b00100001,
298- 0b00000000,
299- },
300-
301- ['X'] =
302- {
303- 0b00000000,
304- 0b00100001,
305- 0b00100001,
306- 0b00010010,
307- 0b00001100,
308- 0b00010010,
309- 0b00100001,
310- 0b00000000,
311- },
312-
313- ['Y'] =
314- {
315- 0b00000000,
316- 0b00100001,
317- 0b00100001,
318- 0b00010010,
319- 0b00001100,
320- 0b00001100,
321- 0b00001100,
322- 0b00000000,
323- },
324-
325- ['Z'] =
326- {
327- 0b00000000,
328- 0b00111111,
329- 0b00010000,
330- 0b00001000,
331- 0b00000100,
332- 0b00000010,
333- 0b00111111,
334- 0b00000000,
335- },
336-
337- ['a'] =
338- {
339- 0b00000000,
340- 0b00000000,
341- 0b00001110,
342- 0b00010000,
343- 0b00011110,
344- 0b00010010,
345- 0b00011110,
346- 0b00000000,
347- },
348-
349- ['b'] =
350- {
351- 0b00000000,
352- 0b00000010,
353- 0b00000010,
354- 0b00011110,
355- 0b00010010,
356- 0b00010010,
357- 0b00011110,
358- 0b00000000,
359- },
360-
361- ['c'] =
362- {
363- 0b00000000,
364- 0b00000000,
365- 0b00011110,
366- 0b00000001,
367- 0b00000001,
368- 0b00000001,
369- 0b00011110,
370- 0b00000000,
371- },
372-
373- ['d'] =
374- {
375- 0b00000000,
376- 0b00010000,
377- 0b00010000,
378- 0b00011110,
379- 0b00010010,
380- 0b00010010,
381- 0b00011110,
382- 0b00000000,
383- },
384-
385- ['e'] =
386- {
387- 0b00000000,
388- 0b00000000,
389- 0b00011110,
390- 0b00010001,
391- 0b00111111,
392- 0b00000001,
393- 0b00011110,
394- 0b00000000,
395- },
396-
397- ['f'] =
398- {
399- 0b00011000,
400- 0b00000100,
401- 0b00111110,
402- 0b00000100,
403- 0b00000100,
404- 0b00000100,
405- 0b00000100,
406- 0b00000000,
407- },
408-
409- ['g'] =
410- {
411- 0b00000000,
412- 0b00000000,
413- 0b00011110,
414- 0b00010010,
415- 0b00011110,
416- 0b00010000,
417- 0b00010000,
418- 0b00001110,
419- },
420-
421- ['h'] =
422- {
423- 0b00000000,
424- 0b00000010,
425- 0b00000010,
426- 0b00011110,
427- 0b00010010,
428- 0b00010010,
429- 0b00010010,
430- 0b00000000,
431- },
432-
433- ['i'] =
434- {
435- 0b00000000,
436- 0b00000100,
437- 0b00000000,
438- 0b00000100,
439- 0b00000100,
440- 0b00000100,
441- 0b00001100,
442- 0b00000000,
443- },
444-
445- ['j'] =
446- {
447- 0b00001000,
448- 0b00000000,
449- 0b00001000,
450- 0b00001000,
451- 0b00001000,
452- 0b00001000,
453- 0b00001000,
454- 0b00001110,
455- },
456-
457- ['k'] =
458- {
459- 0b00000001,
460- 0b00000001,
461- 0b00001001,
462- 0b00000101,
463- 0b00000011,
464- 0b00000101,
465- 0b00001001,
466- 0b00000000,
467- },
468-
469- ['l'] =
470- {
471- 0b00000000,
472- 0b00000100,
473- 0b00000100,
474- 0b00000100,
475- 0b00000100,
476- 0b00000100,
477- 0b00111100,
478- 0b00000000,
479- },
480-
481- ['m'] =
482- {
483- 0b00000000,
484- 0b00000000,
485- 0b00110110,
486- 0b00101010,
487- 0b00101010,
488- 0b00101010,
489- 0b00101010,
490- 0b00000000,
491- },
492-
493- ['n'] =
494- {
495- 0b00000000,
496- 0b00000000,
497- 0b00011100,
498- 0b00010010,
499- 0b00010010,
500- 0b00010010,
501- 0b00010010,
502- 0b00000000,
503- },
504-
505- ['o'] =
506- {
507- 0b00000000,
508- 0b00000000,
509- 0b00000000,
510- 0b00001110,
511- 0b00010001,
512- 0b00010001,
513- 0b00001110,
514- 0b00000000,
515- },
516-
517- ['p'] =
518- {
519- 0b00000000,
520- 0b00000000,
521- 0b00011110,
522- 0b00010010,
523- 0b00011110,
524- 0b00000010,
525- 0b00000010,
526- 0b00000010,
527- },
528-
529- ['q'] =
530- {
531- 0b00000000,
532- 0b00000000,
533- 0b00011110,
534- 0b00010010,
535- 0b00011110,
536- 0b00010000,
537- 0b00010000,
538- 0b00000000,
539- },
540-
541- ['r'] =
542- {
543- 0b00000000,
544- 0b00000000,
545- 0b00001110,
546- 0b00010010,
547- 0b00000010,
548- 0b00000010,
549- 0b00000010,
550- 0b00000000,
551- },
552-
553- ['s'] =
554- {
555- 0b00000000,
556- 0b00000000,
557- 0b00011110,
558- 0b00000001,
559- 0b00011110,
560- 0b00100000,
561- 0b00011110,
562- 0b00000000,
563- },
564-
565- ['t'] =
566- {
567- 0b00001000,
568- 0b00001000,
569- 0b00111110,
570- 0b00001000,
571- 0b00001000,
572- 0b00001000,
573- 0b00010000,
574- 0b00000000,
575- },
576-
577- ['u'] =
578- {
579- 0b00000000,
580- 0b00000000,
581- 0b00010001,
582- 0b00010001,
583- 0b00010001,
584- 0b00010001,
585- 0b00011110,
586- 0b00000000,
587- },
588-
589- ['v'] =
590- {
591- 0b00000000,
592- 0b00000000,
593- 0b00010001,
594- 0b00010001,
595- 0b00001010,
596- 0b00001010,
597- 0b00000100,
598- 0b00000000,
599- },
600-
601- ['w'] =
602- {
603- 0b00000000,
604- 0b00000000,
605- 0b00010001,
606- 0b00010001,
607- 0b00010101,
608- 0b00010101,
609- 0b00001010,
610- 0b00000000,
611- },
612-
613- ['x'] =
614- {
615- 0b00000000,
616- 0b00000000,
617- 0b00010001,
618- 0b00001010,
619- 0b00000100,
620- 0b00001010,
621- 0b00010001,
622- 0b00000000,
623- },
624-
625- ['y'] =
626- {
627- 0b00000000,
628- 0b00000000,
629- 0b00010001,
630- 0b00010001,
631- 0b00011110,
632- 0b00100000,
633- 0b00011110,
634- 0b00000000,
635- },
636-
637- ['z'] =
638- {
639- 0b00000000,
640- 0b00000000,
641- 0b00111111,
642- 0b00010000,
643- 0b00001000,
644- 0b00000100,
645- 0b00111111,
646- 0b00000000,
647- },
648-
649- ['0'] =
650- {
651- 0b00000000,
652- 0b00011110,
653- 0b00100001,
654- 0b00100001,
655- 0b00100001,
656- 0b00100001,
657- 0b00011110,
658- 0b00000000,
659- },
660-
661- ['1'] =
662- {
663- 0b00000000,
664- 0b00001100,
665- 0b00001000,
666- 0b00001000,
667- 0b00001000,
668- 0b00001000,
669- 0b00111110,
670- 0b00000000,
671- },
672-
673- ['2'] =
674- {
675- 0b00000000,
676- 0b00011110,
677- 0b00100000,
678- 0b00011000,
679- 0b00000100,
680- 0b00000010,
681- 0b00111110,
682- 0b00000000,
683- },
684-
685- ['3'] =
686- {
687- 0b00000000,
688- 0b00111111,
689- 0b00100000,
690- 0b00011110,
691- 0b00100000,
692- 0b00100000,
693- 0b00111111,
694- 0b00000000,
695- },
696-
697- ['4'] =
698- {
699- 0b00000000,
700- 0b00010001,
701- 0b00010001,
702- 0b00111111,
703- 0b00010000,
704- 0b00010000,
705- 0b00010000,
706- 0b00000000,
707- },
708-
709- ['5'] =
710- {
711- 0b00000000,
712- 0b00111111,
713- 0b00000001,
714- 0b00011111,
715- 0b00100000,
716- 0b00100000,
717- 0b00011111,
718- 0b00000000,
719- },
720-
721- ['6'] =
722- {
723- 0b00000000,
724- 0b00011110,
725- 0b00000001,
726- 0b00011111,
727- 0b00100001,
728- 0b00100001,
729- 0b00011110,
730- 0b00000000,
731- },
732-
733- ['7'] =
734- {
735- 0b00000000,
736- 0b00111111,
737- 0b00100000,
738- 0b00010000,
739- 0b00001000,
740- 0b00001000,
741- 0b00001000,
742- 0b00000000,
743- },
744-
745- ['8'] =
746- {
747- 0b00000000,
748- 0b00011110,
749- 0b00100001,
750- 0b00011110,
751- 0b00100001,
752- 0b00100001,
753- 0b00011110,
754- 0b00000000,
755- },
756-
757- ['9'] =
758- {
759- 0b00000000,
760- 0b00011110,
761- 0b00100001,
762- 0b00111110,
763- 0b00100000,
764- 0b00100000,
765- 0b00011110,
766- 0b00000000,
767- },
768-
769- ['?'] =
770- {
771- 0b00000000,
772- 0b00011110,
773- 0b00100001,
774- 0b00010000,
775- 0b00001000,
776- 0b00000000,
777- 0b00001000,
778- 0b00000000,
779- },
780-
781- ['!'] =
782- {
783- 0b00000000,
784- 0b00001100,
785- 0b00001100,
786- 0b00000100,
787- 0b00000100,
788- 0b00000000,
789- 0b00000100,
790- 0b00000000,
791- },
792-
793- [':'] =
794- {
795- 0b00000000,
796- 0b00001100,
797- 0b00001100,
798- 0b00000000,
799- 0b00001100,
800- 0b00001100,
801- 0b00000000,
802- 0b00000000,
803- },
804-
805- [';'] =
806- {
807- 0b00000000,
808- 0b00001100,
809- 0b00001100,
810- 0b00000000,
811- 0b00001100,
812- 0b00001100,
813- 0b00001000,
814- 0b00000000,
815- },
816-
817- ['.'] =
818- {
819- 0b00000000,
820- 0b00000000,
821- 0b00000000,
822- 0b00000000,
823- 0b00000000,
824- 0b00001100,
825- 0b00001100,
826- 0b00000000,
827- },
828-
829-};
830-
831-#endif
+0,
-60
1@@ -1,60 +0,0 @@
2-#include "cotton.h"
3-#include "cottonwindow.h"
4-#include "interpreter.h"
5-#include <stdio.h>
6-#include <stdlib.h>
7-#include <string.h>
8-
9-int main
10-(int argc, char **argv)
11-{
12-
13- // added this specifically with the new user input command in mind, makes it so the terminal isnt so cluttered for when there is user input needed, atleast for me :P
14- printf("\033[2J\033[H");
15-
16- // thank you chld for the idea of changing the scale and having it be optional ^^
17- int scale = 4;
18- char *filename = NULL;
19-
20- if (argc == 4 && strcmp(argv[1], "-s") == 0) {
21- scale = atoi(argv[2]);
22- filename = argv[3];
23- } else if (argc == 2) {
24- filename = argv[1];
25- } else {
26- fprintf(stderr, "usage: cotton <-s scale (scale being 2 or 4)> <file.cot>\n");
27- return 1;
28- }
29-
30- CottonWindow cw;
31-
32- if (!cottonwindow_init(&cw, "cotton", VIDEO_WIDTH * scale, VIDEO_HEIGHT * scale, VIDEO_WIDTH, VIDEO_HEIGHT)) {
33- return 1;
34- }
35-
36- Cotton cotton;
37- cotton_init(&cotton);
38-
39- FILE *file = fopen(filename, "r");
40- if (!file) {
41- fprintf(stderr, "cotton couldn't open \"%s\" :(\n", filename);
42- return 1;
43- }
44-
45- int pitch = sizeof(cotton.video[0]) * VIDEO_WIDTH;
46- int quit = 0;
47-
48- while (!quit) {
49- quit = cottonwindow_process_input(&cw, NULL);
50-
51- if (SDL_GetTicks() >= cotton.ticktock) {
52- cotton_interpret(&cotton, &cw, file);
53- }
54-
55- cottonwindow_update(&cw, cotton.video, pitch);
56- }
57-
58- fclose(file);
59- cottonwindow_destroy(&cw);
60- return 0;
61-}
+0,
-55
1@@ -1,55 +0,0 @@
2-// i would have made this as a shell script but im more familiar with Go anyway so blehh
3-package main
4-
5-import (
6- "fmt"
7- "os"
8-)
9-
10-func main() {
11-
12- fmt.Print("da character / letter : ")
13-
14- var ch string
15- fmt.Scanln(&ch)
16-
17- file, err := os.OpenFile("eikis.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
18-
19- if err != nil {
20- fmt.Println("couldn't open eikis.txt :(")
21- return
22- }
23-
24- defer file.Close()
25-
26- fmt.Println("type a # for a pixel and a . for an empty spot")
27-
28- rows := make([]string, 8)
29-
30- for i := 0; i < 8; i++ {
31- fmt.Printf("%d: ", i)
32- fmt.Scanln(&rows[i])
33- }
34-
35- fmt.Fprintln(file)
36- fmt.Fprintf(file, "['%s'] = {\n", ch)
37-
38- for _, row := range rows {
39- var value uint8
40-
41- for i, pixel := range row {
42- if i >= 6 {
43- break
44- }
45-
46- if pixel == '#' {
47- value |= 1 << i
48- }
49- }
50-
51- fmt.Fprintf(file, " 0b%08b,\n", value)
52- }
53-
54- fmt.Fprintln(file, "},")
55-
56-}