• Commodore Free, Issue 67 - Part7

    From Stephen Walsh@39:901/281 to all on Thu Feb 14 22:34:04 2013
    bar which is put on the screen,
    whilst also setting the border and screen colour to black. This means that
    some bars do not appear as they too are black on a black background, making a nicer maze in my opinion. Well, there's no point in having a colour computer without using the colours, is there?

    Here's the listing:

    0 poke 36879, 8 : print"{CLEAR}" chr$
    (8) chr$(142) : c=646 : x=205.4
    1 poke c, rnd(0)*8 : print chr$( x +
    rnd( 0 ) );: get a$ : if a$ = "" go
    to 1

    - - - - - - - - - - - - - - - - - - -

    PROGRAM FIVE: COLOUR MAZE2 VIC

    This is similar to the above program, but it POKEs a diagonal bar directly to the screen, waits for a key press and then over writes the previous maze if that happens. This version does not scroll, and also disables the RUN/STOP key when you run it, which means that you cannot break out of the program. Here's the source:

    0 poke 36879, 8 : print"{CLEAR}"chr$(
    8) chr$(142) : c = 38400 : s = 7680
    : x = 77.4: l = 505 : k = 198 : pok
    e 808, 100
    1 for i = 0 to l : poke c + i, rnd(0)
    *8 : poke s + i, x + rnd(0) : next
    : poke k, 0:wait k,1 : goto 1

    Please note that in line zero, the forth variable declaration is a lower-case
    L and not a number one (as it appears to be on my screen here anyway). Same with line one in the FOR loop - FOR I = 0 TO L it should read.

    - - - - - - - - - - - - - - - - - - -

    PROGRAM SIX: COLOUR MAZE3 VIC

    This is similar to the above listings, but it uses functions to work out which the random colour and diagonal bar. Functions can be useful, so this is just
    to demonstrate how to use them. This one doesn't disable the RUN/STOP key, so you can break the program at any time. Be aware that I've used the variable L again in lower-case, and at least with the font I'm using here, it looks
    almost identical to the number one.

    0 poke 36879, 8 : print chr$( 8 ) chr
    $( 142 ) : c=38400 : s = 7680 : def
    fna( x ) = 77.4 + rnd( x ) : def fn
    b( y ) = rnd( 0 ) * y : l=505 : k=1
    98
    1 for i = 0 to l : poke c + i, fnb( 8
    ) : poke s + i, fna( 1 ) : next : p
    oke k, 0 : wait k, 1 : goto 1

    - - - - - - - - - - - - - - - - - - -

    PROGRAM SEVEN : DUAL SCROLL3 C64

    This is a refined version of DUAL SCROLL2 C64, but much quicker, and with inverse text at the top line.

    0 x = 22 : a$ = " here is another dua
    l scrolly type thing. we like one l
    iners. i send greetz to the usual s
    uspects. see what you can do in 1 o
    r 2 lines of basic! bye
    1 a$ = right$( a$, 155 ) + left$( a$,
    1 ) : for i = 0 to x : print : next
    : print left$( a$, 39 )"{HOME}{REVE
    RSE}" left$( a$, 40 ) : poke 2023 ,
    peek( 1063 ) - 128 : x = 21 : get b
    $ : if b$ = "" goto 1

    - - - - - - - - - - - - - - - - - - -

    PROGRAM EIGHT : SKIING C64/128

    Written in BASIC 7, this will happily work in 64 or 128 mode, and may also
    work on the C16 and Plus/4, although I haven't tested it. Use Z and X to move left and right to avoid the trees.

    0 z = 23 : def fna( a ) = a=88 : def
    fnb( b )= b=90 : def fnc( c ) = rnd
    ( 0 ) * c : x = 7 : s = 0 : l = 0 :
    b$="{GREEN}^" : print"{CLEAR}skiing
    one liner", ,"c64/128" : for i = 0
    to 18 : print : next : p = 1104 : t
    = 30 : k = 40 : i = 0 : u = 22
    1 h = p + x : y = fnc( 6 ) : poke h,
    33 : poke h + 1, 33 : print tab( y
    ) b$ tab( 6 + z - fnc( u ) ) b$ : g
    et a$ : a$ = a$ + b$ : x = x - fna(
    asc( left$( a$, 1 ) ) ) + fnb( asc
    ( left$ ( a$, 1 ) ) ) : if peek( h
    + k ) <> t and peek( h + 1) <> t th
    en s = s + 1 : goto 1

    - - - - - - - - - - - - - - - - - - -

    PROGRAM NINE : SKIING VIC

    This is a playable skiing game, more or less. Control the skis with Z and X to move left and right to avoid the keys (up arrows) in green. This was written
    in BASIC 7, using functions again to read the keys as well as decide a random number. Remember that when you use the GET statement, it cannot return a null value, so I've done a work-around in which I concatenate the contents of A$ with B$ and then take the LEFT$ the new value of A$ to the first character (otherwise it doesn't work), as the value x is used to move the skier left and right. It also counts your score for each time you miss a tree. As we're limited to two lines of BASIC, and even with BASIC 7 and BASIC 2 doesn't do IF ELSE IF, you have to type PRINT S to see your score.

    0 z = 11 : def fna( a ) = a=88 : def
    fnb( b ) = b=90 : def fnc( c ) = rn
    d( 0 ) * c : x = 7 : s = 0 : l = 0
    : b$ = "{GREEN}^" : print "{CLEAR}s
    kiing one liner vic" : for i = 0 to
    17 : print : next : p = 7702 : t =
    30 : k = 22 : i = 0 : u = 13 : f =
    33 : v = 38422
    1 h = p + x : y = fnc( z ) : for i =
    0 to 1 : poke h + i, f : poke v + x
    + i, 0 : print spc( y ) b$;: next :
    print : get a$ : a$ = a$ + b$ : x =
    x - fna( asc( left$( a$, 1 ) ) ) +
    fnb( asc( left$( a$, 1 ) ) ) : for
    i = 0 to 1 : if peek( h + k + i ) <
    > t then next : s = s + 1 : goto 1

    Remember to remove the unnecessary spaces and use the 128 in 128 mode when writing this program.

    - - - - - - - - - - - - - - - - - - -

    PROGRAM TEN: SKIING III

    This has been written in BASIC 7 again to squeeze in as much logic as
    possible, and works with the C64, VIC, C128, C16 and Plus/4, but has been 'sized' in favour of the VIC-20 as this has the smallest screen.

    0 def fna( a ) = a=88 : def fnb( b )=
    b=90 : def fnc( c ) = rnd( 0 ) * c:
    def fnd( d )= d=100 or d=150 or d=2
    00 : x = 7 : s = 0 : l = 0 : b$ = "
    {GREEN}^" : c$="{BLACK}!!" : t = 0
    : n = 13 : u$ = "{UP}" : print "{CL
    EAR}skiing one liner", ,"vic/64/128
    " : print : print
    1 y = fnc(6) : print tab( x ) c$ chr$
    ( n )tab( y + l ) b$ tab( y + 10 -
    l ) b$ u$ : get a$ : a$ = a$ + b$ :
    x = x - fna( asc( left$( a$, 1 ) )
    ) + fnb( asc( left$( a$, 1 ) ) ) :
    if x > y + l and x < y + 8 - l then
    s = s + 1 : l = l - fnd( s ) : goto
    1

    - - - - - - - - - - - - - - - - - - -

    AND NOW FOR THE RULES:

    * Machine code can be used if it's using a MC loader (DATA/FOR/POKE combo) - 0 sys 2059 which then runs an entire game written in assembly, C or some other compiled or assembled code is not a one liner for the purposes of this competition.

    * For two-liners, the first line should be used for variables, functions and data, and the second should contain the logic.

    * Please provide as much information as possible with your submissions, i.e., what you were trying to achieve, and how far you think you got to achieving
    it; how you created your program (genuine one liner, BASIC 7 or whatever).

    * Entries are welcome on all Commodore 8-bit formats in any known variant of BASIC - please save them to a D64 disk image along with your documentation.
    So, you could try something for the C128, for instance.

    * Have fun with it - remember, 640 bytes ought to be enough for anyone!

    * The closing date is Friday 8th March 2013 at 11:59pm GMT. The winner will be announced in the next available issue of Commodore FREE, and through the various forums that we use. We will dig out some prizes for you.

    Please email in with any questions that you may have if these rules do not
    seem clear. Please submit your work by the deadline using email to commodorefree@commodorefree.com, or ask about the Dropbox folder that has
    been set up to accept submissions.


    *************************************
    HOMEBREWING COMPUTERS
    IN THE 21ST CENTURY
    *************************************

    Building your own computer can be both a very satisfying hobby and a valuable learning experience. This article provides an overview of what is involved and may convince you that it is a trip worth embarking on.

    Technology develops at break-neck speed. Today, there is no sensible use for 8-bit, 64 kilobyte computers with less processing power than a mobile phone. Yet, a lively 'Retro computing' subculture has existed ever since the 8080, Z80, 6809 and 6502 processors faded out of view. Already in the early 1990s, nostalgic users wrote software e
    --- CrashWrite 2.0
    * Origin: --:)-- Dragon's Lair BBS --(:- (39:901/281)