Discussion:
Minefield prog
(too old to reply)
Kerr-Mudd, John
2021-05-16 10:01:56 UTC
Permalink
Not in 256 bytes, sadly. But it does come with a pretty border.

debug dump: (use xxd-r to recreate)


-u
162F:0100 B8 00 B8 50-B4 90 50 50-07 B9 A0 0F-B4 0F 99 F2 ...P..PP........
162F:0110 AB 1F 07 BD-BB 00 E8 86-00 BA 1C 07-BF 98 04 B4 ................
162F:0120 02 CD 10 B4-00 CD 16 88-E0 3C 39 75-1F 26 8A 05 .........<9u.&..
162F:0130 3C 23 75 05-B8 21 0C EB-0E 3C 3F 75-03 B8 23 0F <#u..!...<?u..#.
162F:0140 3C 21 75 03-B8 3F 0F 26-89 05 EB D7-3C 4B 75 08 <!u..?.&....<Ku.
162F:0150 80 FA 14 74-CE 4A 4F 4F-3C 4D 75 07-80 FA 24 74 ...t.JOO<Mu...$t
162F:0160 C2 42 AF B1-A0 3C 48 75-09 80 FE 02-74 B5 FE CE .B...<Hu....t...
162F:0170 29 CF 3C 50-75 09 80 FE-0C 74 A8 FE-C6 01 CF 3C ).<Pu....t.....<
162F:0180 01 74 1A 3C-1C 75 98 8B-05 3C 2A 74-0A E8 A2 00 .t.<.u...<*t....
162F:0190 75 91 AB B4-0A EB 08 B8-0F 0C 89 FE-AB B4 0D BF u...............
162F:01A0 C6 00 E8 4C-00 83 C7 7A-B1 0B B0 7C-AB B5 11 50 ...L...z...|...P
162F:01B0 09 D2 74 1E-8B 05 26 80-3D 21 75 09-3C 2A 74 23 ..t...&.=!u.<*t#
162F:01C0 B8 58 0B EB-1E 3C 2A 75-06 B0 4F 39-FE 75 14 AF .X...<*u..O9.u..
162F:01D0 EB 12 E4 40-24 43 75 08-4D E8 29 00-C7 05 2A 0C ...@$Cu.M.)...*.
162F:01E0 B8 23 0F AB-58 FE CD 75-C6 B0 7C AB-83 C7 7A E2 .#..X..u..|...z.
162F:01F0 B9 B0 2B AB-B9 11 00 B0-2D AB E2 FD-B0 2B AB C3 ..+.....-....+..
162F:0200 E8 48 00 74-FA 51 57 50-B9 03 00 81-EF A2 00 B3 .H.t.QWP........
162F:0210 03 8B 05 09-D2 74 07 E8-18 00 75 08-74 10 3C 2A .....t....u.t.<*
162F:0220 74 02 FE 05-AF 4B 75 E9-81 C7 9A 00-E2 E1 58 5F t....Ku.......X_
162F:0230 59 C3 26 80-3D 23 75 17-3C 00 75 0A-51 57 53 E8 Y.&.=#u.<.u.QWS.
162F:0240 BE FF 5B 5F-59 C3 88 C4-0D 30 70 26-89 05 4D C3 ..[_Y....0p&..M.
--
Bah, and indeed Humbug.
wolfgang kern
2021-05-16 11:34:20 UTC
Permalink
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
debug dump: (use xxd-r to recreate)
162F:0100 B8 00 mov ax,b800 |push ax |mov ah 90
0102 B8 50 mov ax,b450 |nop
0104-B4 90 mov ah,90
0106 50 50

looks suspicious like multiple loop entries to me
__
wolfgang

-07 B9 A0 0F-B4 0F 99 F2 ...P..PP........
Post by Kerr-Mudd, John
162F:0110 AB 1F 07 BD-BB 00 E8 86-00 BA 1C 07-BF 98 04 B4 ................
162F:0120 02 CD 10 B4-00 CD 16 88-E0 3C 39 75-1F 26 8A 05 .........<9u.&..
162F:0130 3C 23 75 05-B8 21 0C EB-0E 3C 3F 75-03 B8 23 0F <#u..!...<?u..#.
162F:0140 3C 21 75 03-B8 3F 0F 26-89 05 EB D7-3C 4B 75 08 <!u..?.&....<Ku.
162F:0150 80 FA 14 74-CE 4A 4F 4F-3C 4D 75 07-80 FA 24 74 ...t.JOO<Mu...$t
162F:0160 C2 42 AF B1-A0 3C 48 75-09 80 FE 02-74 B5 FE CE .B...<Hu....t...
162F:0170 29 CF 3C 50-75 09 80 FE-0C 74 A8 FE-C6 01 CF 3C ).<Pu....t.....<
162F:0180 01 74 1A 3C-1C 75 98 8B-05 3C 2A 74-0A E8 A2 00 .t.<.u...<*t....
162F:0190 75 91 AB B4-0A EB 08 B8-0F 0C 89 FE-AB B4 0D BF u...............
162F:01A0 C6 00 E8 4C-00 83 C7 7A-B1 0B B0 7C-AB B5 11 50 ...L...z...|...P
162F:01B0 09 D2 74 1E-8B 05 26 80-3D 21 75 09-3C 2A 74 23 ..t...&.=!u.<*t#
162F:01C0 B8 58 0B EB-1E 3C 2A 75-06 B0 4F 39-FE 75 14 AF .X...<*u..O9.u..
162F:01E0 B8 23 0F AB-58 FE CD 75-C6 B0 7C AB-83 C7 7A E2 .#..X..u..|...z.
162F:01F0 B9 B0 2B AB-B9 11 00 B0-2D AB E2 FD-B0 2B AB C3 ..+.....-....+..
162F:0200 E8 48 00 74-FA 51 57 50-B9 03 00 81-EF A2 00 B3 .H.t.QWP........
162F:0210 03 8B 05 09-D2 74 07 E8-18 00 75 08-74 10 3C 2A .....t....u.t.<*
162F:0220 74 02 FE 05-AF 4B 75 E9-81 C7 9A 00-E2 E1 58 5F t....Ku.......X_
162F:0230 59 C3 26 80-3D 23 75 17-3C 00 75 0A-51 57 53 E8 Y.&.=#u.<.u.QWS.
162F:0240 BE FF 5B 5F-59 C3 88 C4-0D 30 70 26-89 05 4D C3 ..[_Y....0p&..M.
Kerr-Mudd, John
2021-05-16 12:13:25 UTC
Permalink
On Sun, 16 May 2021 13:34:20 +0200
Post by wolfgang kern
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
debug dump: (use xxd-r to recreate)
162F:0100 B8 00 mov ax,b800 |push ax |mov ah 90
correct.
Post by wolfgang kern
0102 B8 50 mov ax,b450 |nop
0104-B4 90 mov ah,90
0106 50 50
no.
Post by wolfgang kern
looks suspicious like multiple loop entries to me
eh? no, it's a lot of stack use to set a data seg (9000), es=scrnseg=B800 and then a default colour stored in the data ('shadow screen') seg (I need es=data seg to use "repnz stosw").

Here's the startup src code:

mov ax,0xB800 ; not a good clr
push ax ; B800
mov ah,0x90 ; for minefield seg
push ax ; to ds later
push ax ;
pop es ; ensure 'stos' to mfld [5]
mov cx,screen_size ;
mov ah,ClrBase ;segnum? nope too low ; border clr 90 no good
cwd ; clr dx as flag
repnz stosw ; cx=0
pop ds ; ds: to mfld from now on
pop es ; ensure 'stosb' to scrn

...
--
Bah, and indeed Humbug.
Kerr-Mudd, John
2021-05-18 18:14:52 UTC
Permalink
On Sun, 16 May 2021 13:13:25 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:34:20 +0200
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
Slight improvement 335 bytes (saved 1, now can't toggle already cleared cells)

162F:0100 B8 00 B8 50-B4 90 50 50-07 B9 A0 0F-B4 0F 99 F2 ...P..PP........
162F:0110 AB 1F 07 BD-BB 00 E8 86-00 BA 1C 07-BF 98 04 B4 ................
162F:0120 02 CD 10 B4-00 CD 16 88-E0 3C 39 75-1F 26 8B 05 .........<9u.&..
162F:0130 3C 21 75 05-B8 3F 0F EB-0E 3C 23 75-03 B8 21 0C <!u..?...<#u..!.
162F:0140 3C 3F 75 03-B8 23 0F 26-89 05 EB D7-3C 4B 75 08 <?u..#.&....<Ku.
162F:0150 80 FA 14 74-CE 4A 4F 4F-3C 4D 75 07-80 FA 24 74 ...t.JOO<Mu...$t
162F:0160 C2 42 AF B1-A0 3C 48 75-09 80 FE 02-74 B5 FE CE .B...<Hu....t...
162F:0170 29 CF 3C 50-75 09 80 FE-0C 74 A8 FE-C6 01 CF 3C ).<Pu....t.....<
162F:0180 01 74 1A 3C-1C 75 98 8B-05 3C 2A 74-0A E8 A1 00 .t.<.u...<*t....
162F:0190 75 91 AB B4-0A EB 08 B8-0F 0C 89 FE-AB B4 0D BF u...............
162F:01A0 C6 00 E8 4C-00 83 C7 7A-B1 0B B0 7C-AB B5 11 50 ...L...z...|...P
162F:01B0 09 D2 74 1E-8B 05 26 80-3D 21 75 09-3C 2A 74 23 ..t...&.=!u.<*t#
162F:01C0 B8 58 0B EB-1E 3C 2A 75-06 B0 4F 39-FE 75 14 AF .X...<*u..O9.u..
162F:01D0 EB 12 E4 40-24 43 75 08-4D E8 28 00-C7 05 2A 0C ...@$Cu.M.(...*.
162F:01E0 B8 23 0F AB-58 FE CD 75-C6 B0 7C AB-83 C7 7A E2 .#..X..u..|...z.
162F:01F0 B9 B0 2B AB-B9 11 00 B0-2D F2 AB B0-2B AB C3 E8 ..+.....-...+...
162F:0200 48 00 74 FA-51 57 50 B9-03 00 81 EF-A2 00 B3 03 H.t.QWP.........
162F:0210 8B 05 09 D2-74 07 E8 18-00 74 12 EB-06 3C 2A 74 ....t....t...<*t
162F:0220 02 FE 05 AF-4B 75 E9 81-C7 9A 00 E2-E1 58 5F 59 ....Ku.......X_Y
162F:0230 C3 26 80 3D-23 75 17 3C-00 75 0A 51-57 53 E8 BE .&.=#u.<.u.QWS..
162F:0240 FF 5B 5F 59-C3 88 C4 0D-30 70 26 89-05 4D C3 20 .[_Y....0p&..M.
--
Bah, and indeed Humbug.
Kerr-Mudd, John
2021-06-04 14:11:22 UTC
Permalink
On Tue, 18 May 2021 19:14:52 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:13:25 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:34:20 +0200
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
Slight improvement 335 bytes (saved 1, now can't toggle already cleared cells)
Ok 256 bytes (255 actually)
Can only mark/unmark with Space key, very poor mine placement RNG, I can only get 2 out of 3 good colours schemes on exit, so Escape shows black dashes on a brown background where the mines are.


-> d 100 l100
16A2:0100 B8 03 B8 50-B4 BA 50 98-99 CD 10 1F-07 BD 1C 02 ...P..P.........
16A2:0110 E8 74 00 BA-23 0D BF 36-08 B4 02 CD-10 98 CD 16 .t..#..6........
16A2:0120 3C 1B 74 60-88 E0 3C 39-75 16 26 8A-05 B9 23 70 <.t`..<9u.&...#p
16A2:0130 3C 21 74 07-B9 21 7C 3C-23 75 E2 26-89 0D EB DD <!t..!|<#u.&....
16A2:0140 3C 4B 75 08-80 FA 16 74-D4 4A 4F 4F-3C 4D 75 07 <Ku....t.JOO<Mu.
16A2:0150 80 FA 30 74-C8 42 AF B3-A0 3C 48 75-09 80 FE 03 ..0t.B...<Hu....
16A2:0160 74 BB FE CE-29 DF 3C 50-75 09 80 FE-16 74 AE FE t...).<Pu....t..
16A2:0170 C6 01 DF 3C-1C 75 A2 80-3D 2A 73 08-E8 4C 00 75 ...<.u..=*s..L.u
16A2:0180 98 B8 17 1D-35 36 61 BF-DC 01 B1 14-B5 1B 50 09 ....56a.......P.
16A2:0190 D2 74 11 80-3D 2A 73 1D-B8 58 7B 26-80 3D 21 74 .t..=*s..X{&.=!t
16A2:01A0 14 AF EB 12-E4 40 24 46-75 08 4D E8-2E 00 C7 05 .....@$Fu.M.....
16A2:01B0 2A 7C B8 23-70 AB 58 FE-CD 75 D3 83-C7 6A E2 CC *|.#p.X..u...j..
16A2:01C0 C3 88 C4 0D-30 70 26 89-05 4D C3 26-80 3D 23 75 ....0p&..M.&.=#u
16A2:01D0 F9 8B 05 3C-20 75 EA E8-EC FF 74 EE-51 57 B1 03 ...< u....t.QW..
16A2:01E0 81 EF A2 00-B5 03 09 D2-74 05 E8 DE-FF 74 0D FE ........t....t..
16A2:01F0 05 AF FE CD-75 F0 81 C7-9A 00 E2 E8-5F 59 C3 00 ....u......._Y..
--
Bah, and indeed Humbug.
Kerr-Mudd, John
2021-06-21 12:25:03 UTC
Permalink
On Fri, 4 Jun 2021 15:11:22 +0100
Post by Kerr-Mudd, John
On Tue, 18 May 2021 19:14:52 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:13:25 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:34:20 +0200
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
Slight improvement 335 bytes (saved 1, now can't toggle already cleared cells)
Ok 256 bytes (255 actually)
Can only mark/unmark with Space key, very poor mine placement RNG, I can only get 2 out of 3 good colours schemes on exit, so Escape shows black dashes on a brown background where the mines are.
I really, really wanted to make the ! coloured, but that takes me to 258;
still monochrome; filled in bkgd this time!

uses LU for toggling marked location #->!->?->#, l254

-> d 100 l100
16A2:0100 B8 03 B8 50-B4 BA 50 98-99 CD 10 1F-07 BD 1C 02 ...P..P.........
16A2:0110 E8 6F 00 BA-23 0D BF 36-08 B4 02 CD-10 98 CD 16 .o..#..6........
16A2:0120 3C 1B 74 5B-88 E0 3C 39-75 11 B1 04-BE FA 01 2E <.t[..<9u.......
16A2:0130 AC 26 3A 05-E0 F9 E3 03-2E A4 4F 3C-4B 75 08 80 .&:.......O<Ku..
16A2:0140 FA 16 74 D9-4A 4F 4F 3C-4D 75 07 80-FA 30 74 CD ..t.JOO<Mu...0t.
16A2:0150 42 AF B3 A0-3C 48 75 09-80 FE 03 74-C0 FE CE 29 B...<Hu....t...)
16A2:0160 DF 3C 50 75-09 80 FE 16-74 B3 FE C6-01 DF 3C 1C .<Pu....t.....<.
16A2:0170 75 A7 80 3D-2A 73 08 E8-4C 00 75 9D-B8 17 1D 35 u..=*s..L.u....5
16A2:0180 36 61 BF DC-01 B1 14 B5-1B 50 09 D2-74 11 80 3D 6a.......P..t..=
16A2:0190 2A 73 1D B8-58 7B 26 80-3D 21 74 14-AF EB 12 E4 *s..X{&.=!t.....
16A2:01A0 40 24 46 75-08 4D E8 2E-00 C7 05 2A-7C B8 23 70 @$Fu.M.....*|.#p
16A2:01B0 AB 58 FE CD-75 D3 83 C7-6A E2 CC C3-88 C4 0D 30 .X..u...j......0
16A2:01C0 70 26 88 05-4D C3 26 80-3D 23 75 F9-8A 05 3C 20 p&..M.&.=#u...<
16A2:01D0 75 EA E8 EC-FF 74 EE 51-57 B1 03 81-EF A2 00 B5 u....t.QW.......
16A2:01E0 03 09 D2 74-05 E8 DE FF-74 0D FE 05-AF FE CD 75 ...t....t......u
16A2:01F0 F0 81 C7 9A-00 E2 E8 5F-59 C3 23 21-3F 23 ......._Y.#!?#
--
Bah, and indeed Humbug.
Kerr-Mudd, John
2021-08-17 12:52:15 UTC
Permalink
On Mon, 21 Jun 2021 13:25:03 +0100
Post by Kerr-Mudd, John
On Fri, 4 Jun 2021 15:11:22 +0100
Post by Kerr-Mudd, John
On Tue, 18 May 2021 19:14:52 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:13:25 +0100
Post by Kerr-Mudd, John
On Sun, 16 May 2021 13:34:20 +0200
Post by Kerr-Mudd, John
Not in 256 bytes, sadly. But it does come with a pretty border.
Slight improvement 335 bytes (saved 1, now can't toggle already cleared cells)
Ok 256 bytes (255 actually)
Can only mark/unmark with Space key, very poor mine placement RNG, I can only get 2 out of 3 good colours schemes on exit, so Escape shows black dashes on a brown background where the mines are.
I really, really wanted to make the ! coloured, but that takes me to 258;
still monochrome; filled in bkgd this time!
uses LU for toggling marked location #->!->?->#,
Colo(u)r version in 256
Numbers are coloured by erm the number amount (so 1 is blue, 2 is green etc)

There's a known bug that if one incorrectly make marks (space toggle) mines in open space, then the clear rtn will show them as numbers. fixing this is 2 bytes, but 2 too many!



-> d 100 l200
16A2:0100 B8 03 B8 50-B4 BA 50 98-99 CD 10 1F-07 BD 1C 02 ...P..P.........
16A2:0110 E8 6F 00 BA-23 0D BF 36-08 B4 02 CD-10 98 CD 16 .o..#..6........
16A2:0120 3C 1B 74 5B-88 E0 3C 39-75 11 B1 05-BE F8 01 26 <.t[..<9u......&
16A2:0130 3A 05 2E AD-E0 F9 E3 03-26 89 05 3C-4B 75 08 80 :.......&..<Ku..
16A2:0140 FA 16 74 D9-4A 4F 4F 3C-4D 75 07 80-FA 30 74 CD ..t.JOO<Mu...0t.
16A2:0150 42 AF B3 A0-3C 48 75 09-80 FE 03 74-C0 FE CE 29 B...<Hu....t...)
16A2:0160 DF 3C 50 75-09 80 FE 16-74 B3 FE C6-01 DF 3C 1C .<Pu....t.....<.
16A2:0170 75 A7 80 3D-20 72 08 E8-49 00 75 9D-B8 17 1D 35 u..= r..I.u....5
16A2:0180 36 61 BF 72-01 B1 14 83-C7 6A B5 1B-50 09 D2 74 6a.r.....j..P..t
16A2:0190 11 80 3D 20-72 1B B8 58-7B 26 80 3D-21 74 12 AF ..= r..X{&.=!t..
16A2:01A0 EB 10 E4 40-24 46 75 06-4D 88 05 E8-27 00 B8 23 ...@$Fu.M...'..#
16A2:01B0 70 AB 58 FE-CD 75 D5 E2-CE C3 08 C4-0C 30 26 89 p.X..u.......0&.
16A2:01C0 05 4D C3 26-80 3D 23 75-F9 B8 20 70-32 05 75 EA .M.&.=#u.. p2.u.
16A2:01D0 E8 EB FF 74-ED 51 57 B1-03 81 EF A2-00 B5 03 09 ...t.QW.........
16A2:01E0 D2 74 05 E8-DD FF 74 0D-FE 05 AF FE-CD 75 F0 81 .t....t......u..
16A2:01F0 C7 9A 00 E2-E8 5F 59 C3-3F 70 23 70-21 7C 3F 70 ....._Y.?p#p!|?p
Post by Kerr-Mudd, John
--
Bah, and indeed Humbug.
--
Bah, and indeed Humbug.
Kerr-Mudd, John
2021-08-18 20:43:00 UTC
Permalink
On Tue, 17 Aug 2021 13:52:15 +0100
Post by Kerr-Mudd, John
On Mon, 21 Jun 2021 13:25:03 +0100
Colo(u)r version in 256
Numbers are coloured by erm the number amount (so 1 is blue, 2 is green etc)
There's a known bug that if one incorrectly make marks (space toggle) mines in open space, then the clear rtn will show them as numbers. fixing this is 2 bytes, but 2 too many!
"Fixed" but only by allowing toggle on any square.

16A6:0100 B8 03 B8 50-B4 BA 50 98-99 CD 10 1F-07 BD 1C 02 ...P..P.........
16A6:0110 E8 6D 00 BA-23 0D BF 36-08 B4 02 CD-10 98 CD 16 .m..#..6........
16A6:0120 3C 1B 74 59-88 E0 3C 39-75 0F B1 04-BE F8 01 26 <.tY..<9u......&
16A6:0130 3A 05 2E AD-E0 F9 26 89-05 3C 4B 75-08 80 FA 16 :.....&..<Ku....
16A6:0140 74 DB 4A 4F-4F 3C 4D 75-07 80 FA 30-74 CF 42 AF t.JOO<Mu...0t.B.
16A6:0150 B3 A0 3C 48-75 09 80 FE-03 74 C2 FE-CE 29 DF 3C ..<Hu....t...).<
16A6:0160 50 75 09 80-FE 16 74 B5-FE C6 01 DF-3C 1C 75 A9 Pu....t.....<.u.
16A6:0170 80 3D 20 72-08 E8 49 00-75 9F B8 17-1D 35 36 61 .= r..I.u....56a
16A6:0180 BF 72 01 B1-14 83 C7 6A-B5 1B 50 09-D2 74 11 80 .r.....j..P..t..
16A6:0190 3D 20 72 1B-B8 58 7B 26-80 3D 21 74-12 AF EB 10 = r..X{&.=!t....
16A6:01A0 E4 40 24 46-75 06 4D 88-05 E8 27 00-B8 23 70 AB .@$Fu.M...'..#p.
16A6:01B0 58 FE CD 75-D5 E2 CE C3-08 C4 0C 30-26 89 05 4D X..u.......0&..M
16A6:01C0 C3 26 80 3D-23 75 F9 B8-20 70 32 05-75 EA E8 EB .&.=#u.. p2.u...
16A6:01D0 FF 74 ED 51-57 B1 03 81-EF A2 00 B5-03 09 D2 74 .t.QW..........t
16A6:01E0 07 E8 DD FF-74 0F 75 02-FE 05 AF FE-CD 75 EE 81 ....t.u......u..
16A6:01F0 C7 9A 00 E2-E6 5F 59 C3-23 70 21 7C-3F 70 23 70 ....._Y.#p!|?p#p

std csr move L,R,U,D from int 16, cls from int 10.
Space key to mark as mine (red "!") again for (black) "?", toggle any char to Unknown (black '#')
Number of neighboring mines shown as coloured number.
Enter key to tread on square.
Win shows red '!' for mines,
Lose shows purple '*' for mine: cyan blue 'X' for marking as a mine incorrectly.
Escape key shows mine locations as black '-' on brown; can't have everything!

I'll shutup now.
--
Bah, and indeed Humbug.
Continue reading on narkive:
Loading...