A82: Re: The Speed82 Competition


[Prev][Next][Index][Thread]

A82: Re: The Speed82 Competition




If you want a small routine do this:

add $40 ; Convert #s to A,B or C
ld bc,128 ; number of chars on the screen
ld hl,TEXT_MEM ; pointer to text mem
ld de,TEXT_MEM+1 ; Guess what !
ld (hl),a
ldir
ROM_CALL(UP_TEXT)

If you want a fast routine do this

dec a
jr z,dispa
dec a
jr z,dispb
dispc:
  ld hl,cimage
  jr showscrn
dispb:
  ld hl,bimage
  jr showscrn
dispa:
 ld hl,aimage
 jr showscrn

(aimage is an image of the screen filled with A's, bimage is an image of
the screen filled with B's and cimage is an image of the sceen filled with
C's. showscrn is Sam Davies routines to display an image on the display
(faster possible routine), modified so it takes a pointer to the image in
hl.)

Dines 
>0 Asm82@aol.com >
0 Your name here >
>Welcome to the Speed82 competition!
>
>Every week, I will post a problem that you must solve.  Those who
participate
>will get their names posted in the next mailing of this letter and on a
web
>page whose address is yet to be announced.  Next to their email address
will
>be their total score (keep reading to find out how the points work).
>
>THE POINT SYSTEM:
>1 point for participating
>5 points for the most creative approach to solving the problem
>10 points given to the person who submits the smallest amount of working
code
>10 points given to the fastest working code
>
>THE PROBLEM:
>You must create a subroutine that takes a value in register A.  A has
either
>the value 1,2, or 3.  Depending on the input in A, you must fill the
screen
>with one of three different characters, depending on what the value in A
is.
>
>Example:
>if A has the value 1, the screen is completely filled with 'A's
>if A has the value 2, the screen is filled with 'B's
>if A has the value 3, the screen is filled with 'C's
>

_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________