Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious challenge: Graphics demo within 25 LINES OR FEWER!
#20
23 lines, longest is 208 characters. It's probably not as impressive as some of the others.

No use of colons, but I hope the DEF FN doesn't count as a function, which the rules disallow.

Code:
DEFINT A-Z
SCREEN 13
DEF fnFormula (a)
  IF a < 64 * 3 AND (a MOD 3) <> 0 THEN b = ABS(FIX(63.5 - a \ 3)) * (ABS(FIX(ABS(FIX(63.5 - a \ 3)) - 31.5)) / 31) * ((b / 63) + (1 - b / 63) * (-(a < 32 * 3 OR a >= 96 * 3))) ELSE b = ABS(FIX(63.5 - a \ 3))
  IF a >= 64 * 3 AND (a MOD 3) <> 2 THEN b = ABS(FIX(63.5 - a \ 3)) * (ABS(FIX(ABS(FIX(63.5 - a \ 3)) - 31.5)) / 31) * ((b / 63) + (1 - b / 63) * (-(a < 32 * 3 OR a >= 96 * 3)))
  fnFormula = b
END DEF
FOR y = 0 TO 191
  FOR x = 0 TO 319
    PSET (x, y), ((x XOR y) AND 127) + 1
  NEXT x
NEXT y
DO
  o = (o + 1) AND 127
  WAIT &H3DA, 8
  OUT 968, 1
  FOR a = o * 3 TO 127 * 3 + 2
    OUT 969, fnFormula(a)
  NEXT a
  FOR a = 0 * 3 TO o * 3 - 1
    OUT 969, fnFormula(a)
  NEXT a
LOOP UNTIL LEN(INKEY$)

I know those formulas need to simplified, but I'm too lazy. Setting the palette first, and then just rotating it would be faster, but this was the only way I could think of the get it under 25.

It was so fast on my computer that I had to put in a vertical retrace delay, but it'll probably crawl on a comp much slower than mine (I'm on a 1.6 ghz), removing the "WAIT &H3DA, 8" line and compiling it should help.

EDIT: just looked at relsoft's entries. You rock, relsoft! Those are incredible.
Reply


Messages In This Thread
Specification...What is a line? - by Mango - 07-09-2003, 08:28 AM
25-line graphics demo... - by Mango - 07-09-2003, 10:41 AM
Serious challenge: Graphics demo within 25 LINES OR FEWER! - by Sterling Christensen - 07-09-2003, 01:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)