Recent Posts

Pages: [1] 2 3 ... 10
1
QB64 Discussion / Re: Redefine Characters
« Last post by Pete on Today at 02:46:50 AM »
My thoughts are no one wanted to bother putting this feature in QB64. Atari BASIC even had the ability to make your own 8x8 characters back in the 1980s. The ATARI statements probably poked the pixels into memory. I do recall you had to pick an ASCII character, and reassign it to your custom character. So print CHR$(1) could be made into a frame character by blacking out all the outside pixels of the 8x8 character matrix.

Pete
2
So its been running great for a while but I made a few tweaks. To highlight down nodes better.
Code: [Select]
SCREEN 0: WIDTH 80, 50
DIM SHARED ConfigFile$, ReadMe$
ConfigFile$ = "config.ini"
ReadMe$ = "read.me.txt"
IF _FILEEXISTS(ConfigFile$) = 0 THEN CALL example(ConfigFile%, ReadMe%)
IF _FILEEXISTS(ReadMe$) = 0 THEN CALL example(ConfigFile%, ReadMe%)
COLOR 3, 1: CLS
flag = 0: set = 0: AlertLocation = 68: AlertLocationHigh = 10: ipstartline = 4
DO
    DownLog$ = "Down" + DATE$ + ".LOG"
    IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
    IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
    IF Char$ = "A" THEN flag = 0: set = 0
    IF flag = 1 AND set = 0 THEN
        set = 1
        COLOR 20, 15
        LOCATE AlertLocationHigh, AlertLocation: PRINT "****"
        COLOR 4, 15
        LOCATE AlertLocationHigh + 2, AlertLocation - 6: PRINT "Hold A to clear"
        LOCATE AlertLocationHigh + 3, AlertLocation - 10: PRINT "Log=" + DownLog$
        LOCATE AlertLocationHigh + 4, AlertLocation - 10: PRINT "Press L For Todays Log"
    END IF

    IF flag = 0 AND set = 0 THEN
        set = 2
        COLOR 3, 1
        LOCATE AlertLocationHigh, AlertLocation: PRINT "    "
        LOCATE AlertLocationHigh + 2, AlertLocation - 6: PRINT "                "
        LOCATE AlertLocationHigh + 3, AlertLocation - 10: PRINT "                      "
    END IF

    Char$ = INKEY$: IF Char$ = CHR$(27) THEN 999
    IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
    IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
    IF Char$ = "A" THEN flag = 0: set = 0
    OPEN ConfigFile$ FOR INPUT AS #1
    OPEN DownLog$ FOR APPEND AS #2
    COLOR 14, 1
    Title1$ = "Network up/down"
    Title2a$ = "Press ESC to exit"
    Title2b$ = "Press L For Todays Log"
    Title2c$ = "Press E to edit IP list"
    Title3$ = "Settings file (" + ConfigFile$ + ") found."
    note$ = "File " + ConfigFile$ + " can be edited while the program runs. IPs scroll."
    LOCATE AlertLocationHigh - 1, AlertLocation - 8: PRINT Title2a$
    LOCATE AlertLocationHigh + 4, AlertLocation - 10: PRINT Title2b$
    LOCATE AlertLocationHigh + 5, AlertLocation - 11: PRINT Title2c$

    LOCATE 3, 41 - LEN(Title1$) / 2: PRINT Title1$: COLOR 4, 15: LOCATE 2, 7: PRINT "Local IP (" + LTRIM$(GetLocalIP$) + ")"
    IF _FILEEXISTS(ConfigFile$) THEN COLOR 13, 1: LOCATE 4, 41 - LEN(Title3$) / 2: PRINT Title3$
    LOCATE 50, 41 - LEN(note$) / 2: PRINT note$;
    DO
        Char$ = INKEY$: IF Char$ = CHR$(27) THEN 999
        IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
        IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
        IF Char$ = "A" THEN flag = 0: set = 0
        IF flag = 1 AND set = 0 THEN
            set = 1
            COLOR 20, 15
            LOCATE AlertLocationHigh, AlertLocation: PRINT "****"
            COLOR 4, 15
            LOCATE AlertLocationHigh + 2, AlertLocation - 6: PRINT "Hold A to clear"
            LOCATE AlertLocationHigh + 3, AlertLocation - 10: PRINT "Log=" + DownLog$
            LOCATE AlertLocationHigh + 4, AlertLocation - 10: PRINT "Press L For Todays Log"
        END IF

        IF flag = 0 AND set = 0 THEN
            set = 2
            COLOR 3, 1
            LOCATE AlertLocationHigh, AlertLocation: PRINT "    "
            LOCATE AlertLocationHigh + 2, AlertLocation - 6: PRINT "                "
            LOCATE AlertLocationHigh + 3, AlertLocation - 10: PRINT "                      "

        END IF

        IF EOF(1) THEN CLOSE: EXIT DO
        LINE INPUT #1, ipLine$
        Char$ = INKEY$: IF Char$ = CHR$(27) THEN 999
        IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
        IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
        IF Char$ = "A" THEN flag = 0: set = 0
        ip$ = LEFT$(ipLine$, INSTR(ipLine$, " ") - 1)
        desc$ = RIGHT$(ipLine$, LEN(ipLine$) - LEN(ip$) - 1)
        COLOR 8, 15: b = 5: c = 2 'b moves IP and description status line over while c moves **/up/down around that line
        LOCATE 2, 64 - LEN(DATE$ + " " + LEFT$(TIME$, 5)) / 2: PRINT DATE$ + " " + LEFT$(TIME$, 5)
        linelocate = linelocate + 1: IF linelocate = 45 THEN linelocate = 1
        lineclear$ = "": FOR lclear = 1 TO 52: lineclear$ = lineclear$ + " ": NEXT
        LOCATE linelocate + ipstartline, b: COLOR 3, 1: PRINT lineclear$
        IF yesno = 0 THEN COLOR 15, 1 ELSE COLOR 15, 6
        LOCATE linelocate + ipstartline, b: PRINT "Ping ("; ip$; ") ("; desc$; ")";
        Char$ = INKEY$: IF Char$ = CHR$(27) THEN 999
        IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
        IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
        IF Char$ = "A" THEN flag = 0: set = 0
        COLOR 7, 1: LOCATE , c: PRINT "** ";
        ' Shell to ping and get results 0 up 1 down
        result& = _SHELLHIDE("ping " + ip$ + " -n 1 -w 100")
        IF result& = 0 THEN
            'success
            COLOR 2, 15
            LOCATE , c: PRINT "UP"
            COLOR 7, 1
        ELSE
            COLOR 4, 15
            LOCATE , c: PRINT "DN"; " Ping ("; ip$; ") ("; desc$; ")";
            COLOR 7, 1
            PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$ + ") (" + desc$ + ")" + "   Down": flag = 1: set = 0
        END IF
        Char$ = UCASE$(INKEY$): IF Char$ = CHR$(27) THEN 999
        IF Char$ = "E" THEN SHELL _DONTWAIT "notepad " + ConfigFile$
        IF Char$ = "L" THEN SHELL _DONTWAIT "notepad " + DownLog$
        IF Char$ = "A" THEN flag = 0: set = 0
    LOOP
    _LIMIT 1 'once per second
    IF yesno = 0 THEN yesno = 1 ELSE yesno = 0
LOOP
999
PRINT "Shutting down"
SYSTEM

FUNCTION GetLocalIP$
    fill = 3
    SHELL _HIDE "cmd /c ipconfig > IPconfig.tmp"
    OPEN "IPconfig.tmp" FOR INPUT AS #fill
    DO
        LINE INPUT #fill, ipline$
        IF LEFT$(LTRIM$(ipline$), 2) = "IP" THEN
            CLOSE #fill
            GetLocalIP$ = MID$(ipline$, INSTR(ipline$, ":") + 1)
            IF LEFT$(ipline$, 3) = "169" THEN ipline$ = "Invalid IP" + ipline$
            KILL "IPconfig.tmp" 'kill the messenger?
            EXIT DO
        END IF
    LOOP UNTIL EOF(fill)
END FUNCTION

SUB example (ConfigFile%, ReadMe%)
    IF _FILEEXISTS(ConfigFile$) = 0 THEN
        OPEN ConfigFile$ FOR OUTPUT AS #1
        PRINT #1, "192.168.1.1 Router"
        PRINT #1, "1.1.1.1 DNS Server"
        PRINT #1, "192.168.1.254 Wifi Access Point"
        PRINT #1, "qb64.com QB64.com (doesn't exist)"
        PRINT #1, "MUST include Ip, hostname or domain name and a description"
        PRINT #1, "Otherwise the program will not be able to ping properly."
        CLOSE
    END IF
    ReadMe$ = "read.me.txt"
    IF _FILEEXISTS(ReadMe$) = 0 THEN
        OPEN ReadMe$ FOR OUTPUT AS #1
        PRINT #1, "Written by Chris Owen Chris.Owen09@gmail.com"
        PRINT #1, "This program came about from a necessity of keeping tabs on servers, switches, a router, a access point, and some printers, other windows pings were not able to accommodate my needs."
        PRINT #1, "Much thanks goes to FellippeHeitor for the starting code, after seeing how my first work was clumsy he pointed me to what this has become."
        PRINT #1, "visionmercer pointed out another ping parameter that I added as a tweak  looking to make this fast as it can be."
        PRINT #1, "SMcNeill pointed out a flaw staring me in the face.  In the interest of reduction of variables I knew I wanted to check INKEY values but by that I created a problem where a simpler approach was needed. Thanks"
        PRINT #1, "The Config.ini file shall contain all the ips you wish to monitor. It is recommended to edit it to your needs."
        PRINT #1, "The Config.ini file is dynamic so changes can be made without stopping the program, the file is read line by line and not all loaded at one time."
        PRINT #1, "This makes changing the file and reading the data in slower but you can monitor while changes are being done using a text editor."
        PRINT #1, "The program can ping, IPs, domain names and host names, descriptions are necessary. I used ( cmd Ping 1.1.1.1 -n 1 ) for the results"
        PRINT #1, "192.168.1.254 Wifi Access Point will be reported on the main screen as separate items using a UP or DN status."
        PRINT #1, "Since the program has to shell out to run the Cmd PING speed is slow so I have added a -n 1 count instead of the usual 3 count."
        PRINT #1, "This program will show 44 lines of ips, 45 and above will start a scroll effect and will pick up at the first ip in you list."
        PRINT #1, "Downed IPs are logged to a file called ( down????.log ) where ???? is the date it was noticed."
        PRINT #1, "In the log, simple details such as the date, time, and ip and if you put in a description are logged."
        PRINT #1, "ESC exits the program and holding the ( a ) key acknowledges any visual down notification."
        PRINT #1, "The program will self create missing files such as the Config.ini where the IPs are read from, and This read.me.txt file every run."
        PRINT #1, "You MUST include Ip, hostname or domain name and a description.  Otherwise the program will not be able to ping properly."
        PRINT #1, "The pinger now changes color each completed loop so you can see its progress.  On a fast computer with little overhead this thing is blazing."
        PRINT #1, "In addition to ESC and A to acknowledge I added E to launch notepad to edit the IP config file and L to launch the Log of the day."
        PRINT #1, "Tap the buttons a few times to launch The Inkey does not seem to catch even with them spread everywhere in the program."
        PRINT #1, "Added a search function for the IP that the machine is running on since I had a few issues with DHCP not working on a DDWRT that caused a headache. "
        CLOSE
    END IF
    SHELL _DONTWAIT "notepad " + ReadMe$
    SHELL _DONTWAIT "notepad " + ConfigFile$
    SYSTEM
END SUB

3
QB64 Discussion / Re: Redefine Characters
« Last post by johnno56 on Today at 01:39:59 AM »
There are some fine examples amongst that lot, thank you.

But from those examples, strictly speaking, I would probably guess that no, qb64 does not seem to have the ability and I'm ok with that. These days, with machines being WAY faster than the machines of the 80's-90's, scanning; modifying and plotting a character is 'normal' and seems to take little to no time to display the results.

But, wouldn't it be cool, if the ascii character could be tweaked and printed as ac ascii character? Ah the memories.

J

ps: Again. Thank you for the examples...
4
Programs / Re: Tetris
« Last post by bplus on Today at 01:32:55 AM »
What, no Kopi Luwak?
5
Programs / Re: Tetris
« Last post by v on Yesterday at 11:48:51 PM »
6
QB64 Discussion / Re: Redefine Characters
« Last post by FellippeHeitor on Yesterday at 08:48:28 PM »
7
QB64 Discussion / Redefine Characters
« Last post by johnno56 on Yesterday at 08:42:22 PM »
A quick question:

Does QB64 have the ability to redefine ascii characters? I know the Microbee and the Amstrad could change characters. I think the purpose was that it is quicker to display a character than to plot an 8x8 graphic. (maybe not 'today', but back when the CPU's were 4mhz, speed was everything)

I need more coffee...

J
8
Aha, found it!

C:\qb64x64\internal\temp\recent.bin

What seems odd to me is there is a QB64 icon, png artwork, etc. in that temp folder too. I wonder why with all the other temp flders, as it seems these files should never be deleted. Any ideas why Rob put them there?

Pete
9
QB64 Discussion / I made some progress on my file organization...
« Last post by Pete on Yesterday at 02:15:45 PM »
I posted this at QBF: https://www.tapatalk.com/groups/qbasic/viewtopic.php?f=648955&t=39415&p=212455#p212455

Does anyone else here use some sort of utility to reduce clutter when building programs?

Pete
10
Programs / Re: Tetris
« Last post by janaknepal on Yesterday at 01:34:11 PM »
'Thanks for the game I love the most. I have some how modified it. Here's the code.

RANDOMIZE TIMER
DEFLNG A-Z

DIM SHARED piece(6, 3, 1)
DIM SHARED piece_color(6)
DIM SHARED size, sw, sh

size = 30
sw = 10
sh = 18

REDIM SHARED board(sw - 1, sh - 1)

piece(0, 0, 0) = 0: piece(0, 1, 0) = 1: piece(0, 2, 0) = 1: piece(0, 3, 0) = 0
piece(0, 0, 1) = 0: piece(0, 1, 1) = 1: piece(0, 2, 1) = 1: piece(0, 3, 1) = 0

piece(1, 0, 0) = 1: piece(1, 1, 0) = 1: piece(1, 2, 0) = 1: piece(1, 3, 0) = 1
piece(1, 0, 1) = 0: piece(1, 1, 1) = 0: piece(1, 2, 1) = 0: piece(1, 3, 1) = 0

piece(2, 0, 0) = 0: piece(2, 1, 0) = 0: piece(2, 2, 0) = 1: piece(2, 3, 0) = 1
piece(2, 0, 1) = 0: piece(2, 1, 1) = 1: piece(2, 2, 1) = 1: piece(2, 3, 1) = 0

piece(3, 0, 0) = 0: piece(3, 1, 0) = 1: piece(3, 2, 0) = 1: piece(3, 3, 0) = 0
piece(3, 0, 1) = 0: piece(3, 1, 1) = 0: piece(3, 2, 1) = 1: piece(3, 3, 1) = 1

piece(4, 0, 0) = 0: piece(4, 1, 0) = 1: piece(4, 2, 0) = 1: piece(4, 3, 0) = 1
piece(4, 0, 1) = 0: piece(4, 1, 1) = 0: piece(4, 2, 1) = 1: piece(4, 3, 1) = 0

piece(5, 0, 0) = 0: piece(5, 1, 0) = 1: piece(5, 2, 0) = 1: piece(5, 3, 0) = 1
piece(5, 0, 1) = 0: piece(5, 1, 1) = 1: piece(5, 2, 1) = 0: piece(5, 3, 1) = 0

piece(6, 0, 0) = 0: piece(6, 1, 0) = 1: piece(6, 2, 0) = 1: piece(6, 3, 0) = 1
piece(6, 0, 1) = 0: piece(6, 1, 1) = 0: piece(6, 2, 1) = 0: piece(6, 3, 1) = 1

SCREEN _NEWIMAGE((sw + 6) * size, sh * size, 32)

piece_color(0) = _RGB(0, 200, 0)
piece_color(1) = _RGB(200, 0, 0)
piece_color(2) = _RGB(156, 85, 211)
piece_color(3) = _RGB(219, 112, 147)
piece_color(4) = _RGB(0, 100, 250)
piece_color(5) = _RGB(230, 197, 92)
piece_color(6) = _RGB(0, 128, 128)

DIM t AS DOUBLE

redraw = -1

speed = 3
lines = 0
pause = 0
putpiece = 0
startx = (sw - 4) / 2

new_px = (sw + 1) * size
new_py = 2 * size


new_pn = INT(RND * 7)
px = startx
py = 1
rot = 0


title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
_TITLE title$

t = TIMER

DO
     place_new new_pn, new_px, new_py, 0, size
     IF (TIMER - t) > (1 / speed) AND NOT pause THEN
          IF valid(pn, px, py + 1, rot) THEN py = py + 1 ELSE putpiece = -1

          t = TIMER
          redraw = -1
     END IF

     IF putpiece THEN
          IF valid(pn, px, py, rot) THEN
               n = place(pn, px, py, rot)
               IF n THEN
                    lines = lines + n
                    title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
                    _TITLE title$
               END IF
          END IF

          pn = new_pn

          new_pn = INT(RND * 7)

          place_new new_pn, new_px, new_py, 0, size


          px = startx
          py = 0
          rot = 0

          putpiece = 0
          redraw = -1

          IF NOT valid(pn, px, py, rot) THEN
               FOR y = 0 TO sh - 1
                    FOR x = 0 TO sw - 1
                         board(x, y) = 0
                    NEXT
               NEXT
               lines = 0
               title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
               _TITLE title$
          END IF
     END IF

     IF redraw THEN
          LINE (0, 0)-(sw * size, sh * size), _RGB(0, 0, 0), BF
          FOR y = 0 TO sh - 1
               FOR x = 0 TO sw - 1
                    IF board(x, y) <> 0 THEN
                         LINE (x * size, y * size)-STEP(size - 2, size - 2), piece_color(board(x, y) - 1), BF
                    ELSE
                         LINE (x * size, y * size)-STEP(size - 2, size - 2), _RGB(50, 50, 50), B
                    END IF
               NEXT
          NEXT

          FOR y = 0 TO 1
               FOR x = 0 TO 3
                    rotate xx, yy, x, y, pn, rot
                    IF piece(pn, x, y) THEN LINE ((px + xx) * size, (py + yy) * size)-STEP(size - 2, size - 2), piece_color(pn), BF
               NEXT
          NEXT
          _DISPLAY
          redraw = 0
     END IF

     k = _KEYHIT
     IF k THEN
          shift = _KEYDOWN(100304) OR _KEYDOWN(100303)
          SELECT CASE k
               CASE 18432 'up
                    IF valid(pn, px, py, (rot + 1) MOD 4) THEN rot = (rot + 1) MOD 4
                    pause = 0
               CASE 19200 'left
                    IF shift THEN
                         FOR xx = 0 TO sw - 1
                              IF NOT valid(pn, px - xx, py, rot) THEN EXIT FOR
                         NEXT
                         px = px - xx + 1
                    ELSE
                         IF valid(pn, px - 1, py, rot) THEN px = px - 1
                    END IF
                    pause = 0
               CASE 19712 'right
                    IF shift THEN
                         FOR xx = px TO sw - 1
                              IF NOT valid(pn, xx, py, rot) THEN EXIT FOR
                         NEXT
                         px = xx - 1
                    ELSE
                         IF valid(pn, px + 1, py, rot) THEN px = px + 1
                    END IF
                    pause = 0
               CASE 20480, 32 'down
                    IF shift OR k = 32 THEN
                         FOR yy = py TO sh - 1
                              IF NOT valid(pn, px, yy, rot) THEN EXIT FOR
                         NEXT
                         py = yy - 1
                         putpiece = -1
                    ELSE
                         IF valid(pn, px, py + 1, rot) THEN py = py + 1
                    END IF
                    pause = 0
               CASE 112 'p
                    pause = NOT pause
               CASE 13 'enter
                    FOR y = 0 TO sh - 1
                         FOR x = 0 TO sw - 1
                              board(x, y) = 0
                         NEXT
                    NEXT
                    pn = INT(RND * 7)
                    px = startx
                    py = 0
                    rot = 0
                    putpiece = 0
                    lines = 0
                    title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
                    _TITLE title$
               CASE 43, 61 'plus
                    IF speed < 100 THEN
                         speed = speed + 1
                         title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
                         _TITLE title$
                    END IF
               CASE 95, 45
                    IF speed > 1 THEN
                         speed = speed - 1
                         title$ = "LINES = " + LTRIM$(STR$(lines)) + ", SPEED = " + LTRIM$(STR$(speed))
                         _TITLE title$
                    END IF
               CASE 27
                    EXIT DO
          END SELECT

          redraw = -1
     END IF
LOOP
SYSTEM

SUB rotate (xx, yy, x, y, pn, rot)
     SELECT CASE pn
          CASE 0
               rot_new = rot
          CASE 1 TO 3
               rot_new = rot MOD 2
          CASE 4 TO 6
               rot_new = rot
     END SELECT

     SELECT CASE rot_new
          CASE 0
               xx = x
               yy = y
          CASE 1
               xx = y + 2
               yy = 2 - x
          CASE 2
               xx = 4 - x
               yy = 1 - y
          CASE 3
               xx = 2 - y
               yy = x - 1
     END SELECT
END SUB

FUNCTION valid (pn, px, py, rot)
     FOR y = 0 TO 1
          FOR x = 0 TO 3
               rotate xx, yy, x, y, pn, rot
               IF py + yy >= 0 THEN
                    IF piece(pn, x, y) THEN
                         IF (px + xx >= sw) OR (px + xx < 0) THEN
                              valid = 0
                              EXIT FUNCTION
                         END IF
                         IF (py + yy >= sh) THEN
                              valid = 0
                              EXIT FUNCTION
                         END IF
                         IF (py >= 0) THEN
                              IF board(px + xx, py + yy) THEN
                                   valid = 0
                                   EXIT FUNCTION
                              END IF
                         END IF
                    END IF
               END IF
          NEXT
     NEXT

     valid = -1
END FUNCTION

FUNCTION place (pn, px, py, rot)
     lines = 0

     FOR y = 0 TO 1
          FOR x = 0 TO 3
               rotate xx, yy, x, y, pn, rot
               IF py + yy >= 0 THEN IF piece(pn, x, y) THEN board(px + xx, py + yy) = pn + 1
          NEXT
     NEXT

     'clear lines
     FOR y = py - 1 TO py + 2
          IF y >= 0 AND y < sh THEN
               clr = -1
               FOR x = 0 TO sw - 1
                    IF board(x, y) = 0 THEN
                         clr = 0
                         EXIT FOR
                    END IF
               NEXT

               IF clr THEN
                    lines = lines + 1
                    FOR yy = y TO 1 STEP -1
                         FOR x = 0 TO sw - 1
                              board(x, yy) = board(x, yy - 1)
                         NEXT
                    NEXT
               END IF
          END IF
     NEXT

     place = lines
END FUNCTION

SUB place_new (new_pn, new_px, new_py, rot, size)

     FOR x = 0 TO 3 'new_px TO (new_px + 4) * size STEP size
          FOR y = 0 TO 1 'new_py TO (new_py + 2) * size STEP size
               LINE (new_px + size * x, new_py + size * y)-(new_px + (size * x) + size - 2, new_py + (size * y) + size - 2), _RGB(0, 0, 0), BF
          NEXT
     NEXT

     FOR x = 0 TO 3 'new_px TO (new_px + 4) * size STEP size
          FOR y = 0 TO 1 'new_py TO (new_py + 2) * size STEP size
               LINE (new_px + size * x, new_py + size * y)-(new_px + (size * x) + size - 2, new_py + (size * y) + size - 2), _RGB(25, 25, 25), B
          NEXT
     NEXT

     FOR x = 0 TO 3 'new_px TO (new_px + 4) * size STEP size
          FOR y = 0 TO 1 'new_py TO (new_py + 2) * size STEP size
               IF piece(new_pn, x, y) THEN
                    LINE (new_px + size * x, new_py + size * y)-(new_px + (size * x) + size - 2, new_py + (size * y) + size - 2), piece_color(new_pn), BF
               END IF
          NEXT
     NEXT
     _DISPLAY

END SUB
Pages: [1] 2 3 ... 10