Welcome, Guest. Please login or register.
June 27, 2017, 03:57:02 PM
Home Help Search Login Register
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base

Qbasicnews.com  |  QbasicNews.Com  |  Challenges  |  Topic: Challenge.... « previous next »
Pages: [1] 2 3 ... 15 Print
Author Topic: Challenge....  (Read 43686 times)
relsoft
*/-\*
*****
Posts: 3927



WWW
Challenge....
« on: January 27, 2003, 12:47:51 AM »

make a 9 line screen saver

;*)


Colon joined lines are not permited.

Call Absolute and Call Interrupt are not permitted.

Basically same as the old QB45 contest...


Yay!!! First post!!!!
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Agamemnus
x/ \z
*****
Posts: 3491



.
« Reply #1 on: January 28, 2003, 12:32:21 AM »

..
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Glenn
I hold this place together
*****
Posts: 786



WWW
Four lines ...
« Reply #2 on: January 28, 2003, 12:35:24 AM »

CLS
WHILE INKEY$ = ""
WEND
END
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
relsoft
*/-\*
*****
Posts: 3927



WWW
Re: Four lines ...
« Reply #3 on: January 28, 2003, 12:52:56 AM »

Quote from: "Glenn"
CLS
WHILE INKEY$ = ""
WEND
END


*Points handgun to Glenn.....

Anyways, here was my entry into the 7 line qb screen saver contest about 2 years ago.  Third place.....

Code:


1 SCREEN 13
2 LOCATE 25, 1
3 S = S MOD 360 + 2
4 DRAW "ta=" + VARPTR$(S) + "C" + STR$(S \ 2) + "bm 160,98 E40 R30 F40 G40 L30 H40 H40 L30 G40 F40 R30 E40 H30 U33 E30 F30 D33 G30 G30 D33 F30 E30 U33 H30"
5 PRINT
6 IF INKEY$ = "" THEN GOTO 3
7 END

Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Glenn
I hold this place together
*****
Posts: 786



WWW
You forgot to pull the trigger.
« Reply #4 on: January 28, 2003, 03:50:29 AM »

.
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Anonymous
Guest
Challenge....
« Reply #5 on: January 28, 2003, 11:20:52 AM »

OH! DRAW!!! I can decrease my line size by a little with that!! But then it gets REALLY complicated. Sad
Logged
Agamemnus
x/ \z
*****
Posts: 3491



agamemnus
« Reply #6 on: January 28, 2003, 12:38:41 PM »

(last edited -- Jan. 31, 2003)

9 Lines, with exit condition AND a wait parameter!!

Code:

1 SCREEN 7
2 RANDOMIZE TIMER
3 IF I% = 0 THEN tri$ = CHR$(1) + CHR$(INT(RND * 142) + 16) + CHR$(INT(RND * 90) + 10) + CHR$(INT(RND * 35) + 15) + CHR$(INT(RND * 14) + 1) + CHR$(1) ELSE IF LEN(tri$) > 5 THEN MID$(tri$, 6, 1) = CHR$(0)' + CHR$(INT(RND * 15))
4 wait1# = wait1# + 1
5 IF LEN(tri$) > 5 THEN IF wait1# < ASC(MID$(tri$, 6, 1)) * 30000 THEN GOTO 4 ELSE wait1# = 0
6 IF I% = ASC(MID$(tri$, 4, 1)) THEN I% = 0 ELSE I% = I% + 1
7 IF I% = CINT(ASC(MID$(tri$, 4, 1)) * ASC(MID$(tri$, 1, 1)) / 8) THEN tri$ = CHR$(ASC(MID$(tri$, 1, 1)) + 1) + MID$(tri$, 2, 3) + CHR$(15 - ASC(MID$(tri$, 5, 1)))
8 DRAW "BM" + STR$(ASC(MID$(tri$, 2, 1)) + 4) + "," + STR$(ASC(MID$(tri$, 3, 1)) * 3 - 3 - j%) + "P0,15" + "C" + STR$(ASC(MID$(tri$, 5, 1)) * (1 - (I% = 0) * -1)) + "BM" + STR$(ASC(MID$(tri$, 2, 1)) * 2) + "," + STR$(ASC(MID$(tri$, 3, 1)) * 2 - j%)  _
+ "E" + STR$(I%) + "C" + STR$(ASC(MID$(tri$, 5, 1)) * (1 - (I% = 0) * -1)) + "BM" + STR$(ASC(MID$(tri$, 2, 1)) * 2) + "," + STR$(ASC(MID$(tri$, 3, 1)) * 2 - j%) + "BLR" + STR$(I% * 2 + 1) + "C" + STR$(ASC(MID$(tri$, 5, 1)) * (1 - (I% = 0) * -1)) +  _
"BM" + STR$(ASC(MID$(tri$, 2, 1)) * 2 + I%) + "," + STR$(ASC(MID$(tri$, 3, 1)) * 2 - I% - j%) + "F" + STR$(I%)
9 IF INKEY$ = "" THEN GOTO 3 ELSE PRINT "By Agamemnus! Email me at:"; SPACE$(40); "Warlordagamemnus@aol.com"
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
BlueKeyboard
Wandering Guru
***
Posts: 337



WWW
Challenge....
« Reply #7 on: January 28, 2003, 06:22:56 PM »

Here's my "amazing" screensaver Cheesy:
Code:

SCREEN 13
DO
FOR A% = 0 TO 359
PSET (COS(A% * 3.1415 / 180) * R% + 160, SIN(A% * 3.1415 / 180) * R% + 100), A% + C%
NEXT
WAIT &H3DA, 8
C% = C% + 1
R% = INT(RND * 100)
LOOP
Logged

Dav
Administrator
Ancient Guru
*****
Posts: 706



WWW
Challenge....
« Reply #8 on: January 28, 2003, 07:20:32 PM »

Worked on one for hours today, but just couldn't get it under 10 lines, so here's one I already had that made it to 9 lines that I'll post instead.

It's just your basic 3D balls filling up the screen 'till a keypress...

Code:

1  SCREEN 13
2  clr% = 16
3  x% = RND * 320
4  y% = RND * 200
5  FOR z% = (RND * 15 + 1) TO 1 STEP -1
6      CIRCLE (x%, y%), z%, clr%
7      IF INKEY$ = "" THEN PAINT (x%, y%), clr% ELSE END
8      IF z% = 1 THEN GOTO 2 ELSE clr% = clr% + 1
9  NEXT


- Dav
Logged

Agamemnus
x/ \z
*****
Posts: 3491



that's nice. I really ought to improve mine now!!
« Reply #9 on: January 28, 2003, 08:13:10 PM »

Cool screensaver. Putting the variables in a string can save you at least 2 lines of code.

Interesting screensaver Keyboard. But no exit condition? Sad
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Hexadecimal Disaster
Been there, done that
*****
Posts: 1123



Challenge....
« Reply #10 on: January 28, 2003, 11:28:58 PM »

What about Ctrl + Break?  Tongue
Logged

img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Dav
Administrator
Ancient Guru
*****
Posts: 706



WWW
Re: that's nice. I really ought to improve mine now!!
« Reply #11 on: January 28, 2003, 11:32:21 PM »

Quote from: "Agamemnus"
Cool screensaver. Putting the variables in a string can save you at least 2 lines of code.


Hmm...you're right.  Ok, here's that version, making it a 7 line saver doing the exact thing...

Code:

1  SCREEN 13   'below holds the clr%, x%, y%
2  A$ = CHR$(16) + MKI$(RND * 320) + MKI$(RND * 200)
3  FOR z% = (RND * 15 + 1) TO 1 STEP -1
4      CIRCLE (CVI(MID$(A$, 2, 2)), CVI(MID$(A$, 4, 2))), z%, ASC(MID$(A$, 1, 1))
5      IF INKEY$ = "" THEN PAINT (CVI(MID$(A$, 2, 2)), CVI(MID$(A$, 4, 2))), ASC(MID$(A$, 1, 1)) ELSE END
6      IF z% = 1 THEN GOTO 2 ELSE MID$(A$, 1) = CHR$(ASC(MID$(A$, 1, 1)) + 1)
7  NEXT


(sorry if that code word-wraps on your screen)

- Dav
Logged

relsoft
*/-\*
*****
Posts: 3927



WWW
Challenge....
« Reply #12 on: January 29, 2003, 01:16:49 AM »

Kewl ScreenSaver guys!!!!
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
LooseCaboose
I hold this place together
*****
Posts: 981



Challenge....
« Reply #13 on: January 29, 2003, 08:36:41 AM »

Heres a Matrix like screen saver. I cant get it down to 9 lines with the palette changing code so Ill make that optional.

Code:

1 screen 12
2 FOR k = 1 TO 33 STEP 8
3   FOR i = 1 TO 6
4     COLOR INT(RND * 15) + 1
5     LOCATE 29, (i + k - 1) * 2
6     IF k = 33 AND i = 6 THEN PRINT INT(RND * 10) ELSE PRINT INT(RND * 10);
7   NEXT
8 NEXT
9 IF INKEY$ = "" THEN GOTO 1


The optional palette code sits between lines 1 and 2 and sets the colors to 16 shades of green for a real Matrix look Cool. I didnt actually write this bit and I cant remember who I stole it from either. ;-)
Code:

OUT &H3C8, 0
FOR i = 0 TO 15
 OUT &H3C9, (0)
 OUT &H3C9, (i * 4)
 OUT &H3C9, (0)
NEXT
Logged

esus saves.... Passes to Moses, shoots, he scores!
relsoft
*/-\*
*****
Posts: 3927



WWW
Challenge....
« Reply #14 on: January 29, 2003, 08:46:03 AM »

Actually you could fit it in 9 lines loose.

Tips:

1. Use Strings for vars as long as the values are less than 256 you could have as many vars in one line as you want.

2. One OUT statement is enough for rotations
   Ie.
     Do
          X=(X+1) mod 1024
          Out (&h3c8)+((X and 3)=0), "insert formula here
     loop


3. You can do away with the For Do Loops
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Pages: [1] 2 3 ... 15 Print 
Qbasicnews.com  |  QbasicNews.Com  |  Challenges  |  Topic: Challenge.... « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
SMF Theme © Gaia
Valid XHTML 1.0! Valid CSS!