Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Egg Timer - Spoof Program.
#1
Eggtimer.bas by Bob Seguin.
[Image: Screenshot-649.png]
Description: Short spoof on what happened on the way to trying to code an egg timer program.

Code: (Select All)
'*****************************************************
'
'------------------- EGGTIMER.BAS --------------------
'
'----- Freeware by Bob Seguin Copyright (C) 2004 -----
'
'*****************************************************

_TITLE "Eggtime.bas by Bob Seguin"

DEFINT A-Z

DIM SHARED Box(1 TO 1900)

SCREEN 12

SetPALETTE 0
GOSUB GetSPRITES

'Borders
LINE (100, 100)-(539, 379), 8, B
LINE (110, 110)-(529, 369), 8, B
SetPALETTE 1

COLOR 8: LOCATE 20, 34: PRINT "PRESS ANY KEY..."
a$ = INPUT$(1)
Lay
COLOR 8: LOCATE 20, 30: PRINT "PRESS ANY KEY TO EXIT..."
a$ = INPUT$(1)
SYSTEM

GetSPRITES:
'Draw sprites using compressed data
MaxWIDTH = 54
MaxDEPTH = 120
x = 0: y = 0
DO
    READ Count, Colr
    FOR Reps = 1 TO Count
        PSET (x, y), Colr
        x = x + 1
        IF x > MaxWIDTH THEN
            x = 0
            y = y + 1
        END IF
    NEXT Reps
LOOP UNTIL y > MaxDEPTH

'Get sprite images to array
GET (0, 54)-(54, 120), Box()
GET (0, 0)-(13, 14), Box(941)
GET (20, 1)-(34, 11), Box(1003)
GET (40, 0)-(53, 14), Box(1049)
GET (0, 15)-(32, 50), Box(1111)
LINE (0, 0)-(54, 120), 0, BF
PUT (290, 200), Box()
GET (280, 200)-(315, 234), Box(1500) 'Neck in
PUT (280, 200), Box(1111), PSET
PUT (280, 200), Box(1500), PSET
RETURN

DATA 1,15,1,7,3,15,1,7,5,15,29,0,1,15,1,7,3,15,1,7,3,15,1,7
DATA 5,0,7,15,1,7,3,15,1,8,11,0,1,8,2,3,3,7,2,3,1,8,8,0
DATA 6,15,1,7,2,15,1,7,5,0,5,15,1,7,4,15,1,7,1,8,10,0,1,3
DATA 3,7,5,15,1,7,1,3,7,0,5,15,1,7,3,15,1,7,5,0,3,15,3,7
DATA 4,15,2,3,9,0,1,3,2,7,9,15,1,3,6,0,3,15,3,7,3,15,1,7
DATA 5,0,2,7,2,15,2,7,3,15,2,3,1,7,1,15,1,8,6,0,1,8,2,7
DATA 11,15,1,8,5,0,2,7,2,15,2,7,3,15,1,3,5,0,1,15,3,7,1,15
DATA 1,7,3,15,2,3,2,15,1,3,6,0,1,3,2,7,11,15,1,3,5,0,1,15
DATA 3,7,1,15,1,7,2,15,1,7,1,8,5,0,5,7,3,15,2,3,1,7,2,15
DATA 1,7,6,0,1,3,2,7,11,15,1,3,5,0,5,7,3,15,1,7,6,0,4,7
DATA 3,15,2,3,1,7,4,15,6,0,1,3,3,7,10,15,1,3,5,0,4,7,3,15
DATA 1,7,7,0,3,7,4,15,2,3,3,15,1,7,1,3,6,0,1,8,4,7,8,15
DATA 1,7,1,8,5,0,3,7,3,15,1,7,8,0,3,7,3,15,2,3,4,7,1,3
DATA 8,0,1,3,5,7,4,15,2,7,1,3,6,0,3,7,3,15,1,8,8,0,2,7
DATA 3,15,2,3,4,7,1,3,10,0,1,3,9,7,1,3,7,0,2,7,3,15,1,7
DATA 9,0,4,15,2,3,2,7,2,3,1,8,12,0,1,8,2,3,3,7,2,3,1,8
DATA 8,0,3,15,1,7,1,8,10,0,3,15,1,3,36,0,1,15,2,7,12,0,1,7
DATA 1,15,1,3,37,0,1,7,1,8,13,0,1,7,1,8,175,0,1,4,2,0,1,4
DATA 4,0,1,4,45,0,2,4,1,0,2,4,3,0,2,4,45,0,5,4,2,0,3,4
DATA 42,0,2,4,1,0,5,4,1,0,4,4,42,0,17,4,39,0,17,4,39,0,13,4
DATA 42,0,5,15,6,4,43,0,7,15,3,4,37,0,1,14,6,0,9,15,1,4,39,0
DATA 3,14,2,0,3,15,1,4,7,15,1,8,38,0,6,14,1,15,1,4,1,0,1,4
DATA 7,15,1,8,38,0,5,14,2,15,1,4,9,15,1,8,37,0,6,14,12,15,1,8
DATA 37,0,5,14,13,15,1,8,37,0,4,14,14,15,1,8,36,0,3,14,1,7,16,15
DATA 1,8,33,0,3,14,1,6,2,7,17,15,1,8,30,0,3,14,2,0,1,4,1,3
DATA 1,7,18,15,1,7,1,3,1,8,26,0,2,14,3,0,2,4,1,3,1,7,21,15
DATA 25,0,1,14,4,0,4,4,1,7,20,15,24,0,1,14,5,0,5,4,1,7,19,15
DATA 30,0,6,4,1,7,18,15,30,0,6,4,1,8,1,7,17,15,30,0,2,4,1,0
DATA 3,4,1,0,1,8,1,7,16,15,31,0,1,4,1,0,3,4,2,0,1,8,16,15
DATA 33,0,2,4,4,0,1,7,15,15,39,0,1,8,1,7,14,15,40,0,1,8,1,7
DATA 13,15,41,0,1,7,13,15,41,0,1,8,1,7,12,15,42,0,2,7,2,15,1,7
DATA 8,15,42,0,1,3,1,7,2,15,1,7,8,15,42,0,1,8,1,7,2,15,1,7
DATA 8,15,198,0,1,4,3,0,1,4,47,0,2,4,2,0,1,4,2,0,2,4,47,0
DATA 2,4,1,0,2,4,1,0,3,4,46,0,5,4,1,0,3,4,43,0,2,4,1,0
DATA 9,4,43,0,13,4,43,0,12,4,44,0,10,4,44,0,1,8,5,15,1,3,4,4
DATA 43,0,1,8,7,15,1,3,2,4,43,0,1,8,9,15,1,3,44,0,3,15,1,4
DATA 7,15,1,8,42,0,2,14,1,15,1,4,1,0,1,4,6,15,1,7,40,0,4,14
DATA 2,15,1,4,8,15,1,8,38,0,6,14,10,15,1,7,37,0,7,14,11,15,1,8
DATA 28,0,6,8,3,0,6,14,11,15,1,7,26,0,1,8,8,15,1,8,3,0,3,14
DATA 1,7,12,15,1,8,23,0,1,8,3,15,1,7,2,15,1,7,4,15,5,0,1,14
DATA 2,7,11,15,1,7,21,0,1,8,4,15,2,7,1,15,1,7,4,15,1,8,6,0
DATA 1,4,2,7,11,15,1,7,5,0,2,7,5,15,1,7,1,3,1,8,1,0,1,8
DATA 3,7,4,15,1,7,2,15,1,7,4,15,1,8,7,0,2,4,2,7,11,15,1,7
DATA 1,3,1,0,1,7,18,15,2,7,2,15,1,7,5,15,8,0,4,4,1,7,31,15
DATA 1,7,3,15,1,7,5,15,1,8,8,0,5,4,34,15,1,7,5,15,1,3,9,0
DATA 5,4,32,15,2,7,6,15,1,8,9,0,5,4,31,15,1,7,7,15,1,3,10,0
DATA 2,4,1,0,2,4,30,15,1,7,2,15,1,7,5,15,12,0,4,4,35,15,1,7
DATA 2,15,1,3,12,0,3,4,35,15,1,7,3,15,1,8,13,0,1,4,35,15,1,7
DATA 4,15,15,0,1,7,5,15,1,7,27,15,1,7,2,15,1,7,2,15,1,8,14,0
DATA 1,7,5,15,1,7,26,15,1,7,2,15,1,7,3,15,1,3,15,0,1,7,4,15
DATA 1,7,25,15,1,7,8,15,15,0,2,7,2,15,1,7,25,15,1,7,3,15,2,7
DATA 4,15,15,0,1,3,1,7,2,15,1,7,27,15,1,7,2,15,1,7,4,15,15,0
DATA 1,8,1,7,2,15,1,7,26,15,1,7,3,15,1,7,3,15,1,7,15,0,1,8
DATA 1,7,2,15,1,7,19,15,3,7,1,15,2,7,6,15,1,7,2,15,1,7,16,0
DATA 2,7,1,15,3,7,28,15,1,7,3,15,1,7,16,0,1,3,1,7,2,15,3,7
DATA 25,15,3,7,3,15,1,7,16,0,1,8,1,7,2,15,6,7,14,15,2,7,1,15
DATA 4,7,2,15,2,7,3,15,1,3,16,0,1,8,1,7,2,15,9,7,14,15,1,7
DATA 2,15,3,7,1,15,1,7,2,15,1,7,1,8,17,0,1,3,1,7,2,15,11,7
DATA 11,15,7,7,3,15,1,7,19,0,2,7,2,15,27,7,3,15,1,7,21,0,1,7
DATA 3,15,25,7,3,15,1,7,23,0,1,7,2,15,25,7,3,15,1,8,24,0,1,7
DATA 2,15,23,7,3,15,1,7,26,0,1,7,4,15,17,7,4,15,1,7,1,8,28,0
DATA 2,7,4,15,9,7,3,14,1,7,4,15,2,7,31,0,1,3,2,7,5,15,4,7
DATA 6,14,1,15,3,7,1,8,34,0,1,3,4,7,6,15,6,14,2,7,38,0,1,8
DATA 2,3,7,7,6,14,42,0,5,14,4,0,5,14,42,0,3,14,6,0,5,14,40,0
DATA 3,14,8,0,4,14,39,0,3,14,9,0,3,14,39,0,3,14,9,0,3,14,39,0
DATA 3,14,9,0,3,14,39,0,3,14,9,0,3,14,37,0,5,14,9,0,3,14,34,0
DATA 8,14,9,0,3,14,33,0,13,14,2,0,6,14,33,0,1,14,7,0,13,14,41,0
DATA 2,14,2,0,13,14,37,0,2,14,2,0,1,14,7,0,8,14,34,0,1,14,11,0
DATA 2,14,40,0,1,14,11,0,2,14,52,0,1,14,53,0,1,14,28,0

PaletteDATA:
DATA 0,0,12,0,0,42,0,42,0,45,42,42
DATA 63,0,0,42,0,42,42,21,0,56,56,52
DATA 21,21,21,21,21,63,21,63,21,21,63,63
DATA 63,21,21,63,21,63,63,40,0,63,63,63

DropDATA:
DATA 342,236,344,237,346,238,348,239
DATA 350,241,351,244,352,248,352,252

SUB Interval (Length!)

    StartTIME# = TIMER
    DO
    LOOP WHILE TIMER < StartTIME# + Length!

END SUB

SUB Lay

    FOR Reps = 1 TO 3
        PUT (280, 200), Box(1111), PSET
        PLAY "MBT255O1L64cde"
        Interval .1
        PUT (280, 200), Box(1500), PSET
        Interval .1
    NEXT Reps

    PUT (330, 234), Box(941), PSET
    WAIT &H3DA, 8
    PUT (330, 234), Box(1049), PSET
    WAIT &H3DA, 8

    RESTORE DropDATA
    FOR Reps = 1 TO 8
        READ x, y
        PUT (x, y), Box(1003), PSET
        WAIT &H3DA, 8
        PAINT STEP(5, 3), 0
    NEXT Reps
    PUT (x, y), Box(1003), PSET
    PLAY "MBT255L64O3a"
    Interval .4
    PUT (280, 200), Box(1111), PSET
    PLAY "MBT255O1L64cde"
    Interval .1
    PUT (280, 200), Box(1500), PSET
    Interval .5

END SUB

SUB SetPALETTE (OnOFF)

    SELECT CASE OnOFF
        CASE 0
            OUT &H3C8, 0
            FOR n = 1 TO 48
                OUT &H3C9, 0
            NEXT n
        CASE 1
            RESTORE PaletteDATA
            OUT &H3C8, 0
            FOR n = 1 TO 48
                READ Intensity
                OUT &H3C9, Intensity
            NEXT n
    END SELECT

END SUB




Users browsing this thread: 2 Guest(s)