Qbasicnews Forum Index Qbasicnews
Back to QbasicNews.com
QBOHO
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   You have no new messagesYou have no new messages   Log out [ relsoft ]Log out [ relsoft ] 

Challenge....
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    Qbasicnews Forum Index -> Challenges
View previous topic :: View next topic  
Author Message
relsoft
Sanzo


Joined: 05 Nov 2001
Posts: 763
Location: Philippines

PostPosted: 27 Jan 2003 03:47    Post subject: Challenge.... Reply with quote Edit/Delete this post

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!!!!
_________________
Medium or Rare?




Mysite:
Genso' Junkyard
Our game: Frantic Journey

New FJ Screenies:
http://polacka.xepher.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Agamemnus
Guru


Joined: 15 Jan 2003
Posts: 260

PostPosted: 28 Jan 2003 03:32    Post subject: . Reply with quote

..
_________________
"Life is on the edge of Chaos" -- Carl Sagan


Last edited by Agamemnus on 31 Jan 2003 03:33; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address
Glenn
Guru


Joined: 14 Dec 2002
Posts: 266

PostPosted: 28 Jan 2003 03:35    Post subject: Four lines ... Reply with quote

CLS
WHILE INKEY$ = ""
WEND
END
_________________
Travelling Curmudgeon
(geocities sites require copying and pasting URLs.)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relsoft
Sanzo


Joined: 05 Nov 2001
Posts: 763
Location: Philippines

PostPosted: 28 Jan 2003 03:52    Post subject: Re: Four lines ... Reply with quote Edit/Delete this post

Glenn wrote:
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


_________________
Medium or Rare?




Mysite:
Genso' Junkyard
Our game: Frantic Journey

New FJ Screenies:
http://polacka.xepher.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Glenn
Guru


Joined: 14 Dec 2002
Posts: 266

PostPosted: 28 Jan 2003 06:50    Post subject: You forgot to pull the trigger. Reply with quote

.
_________________
Travelling Curmudgeon
(geocities sites require copying and pasting URLs.)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: 28 Jan 2003 14:20    Post subject: Reply with quote

OH! DRAW!!! I can decrease my line size by a little with that!! But then it gets REALLY complicated. icon_frown.gif
Back to top
Agamemnus
Guru


Joined: 15 Jan 2003
Posts: 260

PostPosted: 28 Jan 2003 15:38    Post subject: agamemnus Reply with quote

(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"

_________________
"Life is on the edge of Chaos" -- Carl Sagan


Last edited by Agamemnus on 01 Feb 2003 01:59; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address
BlueKeyboard
Surfing Keyboard


Joined: 19 Apr 2002
Posts: 322

PostPosted: 28 Jan 2003 21:22    Post subject: Reply with quote

Here's my "amazing" screensaver icon_biggrin.gif:
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

_________________
Visit Blind Coding
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dav
Webmaster


Joined: 08 Sep 2001
Posts: 200
Location: USA

PostPosted: 28 Jan 2003 22:20    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Agamemnus
Guru


Joined: 15 Jan 2003
Posts: 260

PostPosted: 28 Jan 2003 23:13    Post subject: that's nice. I really ought to improve mine now!! Reply with quote

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

Interesting screensaver Keyboard. But no exit condition? icon_frown.gif
_________________
"Life is on the edge of Chaos" -- Carl Sagan
Back to top
View user's profile Send private message Send e-mail AIM Address
Hexadecimal Disaster
Ancient Guru


Joined: 02 Jun 2002
Posts: 642
Location: Chile

PostPosted: 29 Jan 2003 02:28    Post subject: Reply with quote

What about Ctrl + Break? icon_razz.gif
Back to top
View user's profile Send private message Send e-mail
Dav
Webmaster


Joined: 08 Sep 2001
Posts: 200
Location: USA

PostPosted: 29 Jan 2003 02:32    Post subject: Re: that's nice. I really ought to improve mine now!! Reply with quote

Agamemnus wrote:
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relsoft
Sanzo


Joined: 05 Nov 2001
Posts: 763
Location: Philippines

PostPosted: 29 Jan 2003 04:16    Post subject: Reply with quote Edit/Delete this post

Kewl ScreenSaver guys!!!!
_________________
Medium or Rare?




Mysite:
Genso' Junkyard
Our game: Frantic Journey

New FJ Screenies:
http://polacka.xepher.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LooseCaboose
Senior Member


Joined: 16 Apr 2002
Posts: 183
Location: New Zealand

PostPosted: 29 Jan 2003 11:36    Post subject: Reply with quote

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 icon_cool.gif. I didnt actually write this bit and I cant remember who I stole it from either. icon_wink.gif
Code:

OUT &H3C8, 0
FOR i = 0 TO 15
OUT &H3C9, (0)
OUT &H3C9, (i * 4)
OUT &H3C9, (0)
NEXT
Back to top
View user's profile Send private message Send e-mail MSN Messenger
relsoft
Sanzo


Joined: 05 Nov 2001
Posts: 763
Location: Philippines

PostPosted: 29 Jan 2003 11:46    Post subject: Reply with quote Edit/Delete this post

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
_________________
Medium or Rare?




Mysite:
Genso' Junkyard
Our game: Frantic Journey

New FJ Screenies:
http://polacka.xepher.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Dav
Webmaster


Joined: 08 Sep 2001
Posts: 200
Location: USA

PostPosted: 29 Jan 2003 14:50    Post subject: Reply with quote

Played around with it a bit more (since I had 2 more lines to use icon_smile.gif )

In this version, PALETTE is used both to make the gradient pallette and as a method for delay. Ball size is increased.

Big BLUE balls....

Code:

1  SCREEN 13
2  FOR c% = -1 TO 63
3    IF c% = -1 THEN A$ = MKI$(RND * 320) + MKI$(RND * 200) + CHR$(8) ELSE PALETTE c%, c% * 65536
4  NEXT
5  FOR z% = RND * 54 TO 0 STEP -1
6     MID$(A$, 5, 1) = CHR$(ASC(MID$(A$, 5, 1)) + 1)
7     IF INKEY$ = "" THEN CIRCLE (CVI(MID$(A$, 1, 2)), CVI(MID$(A$, 3, 2))), z%, ASC(MID$(A$, 5, 1)) ELSE END
8     IF z% = 0 THEN GOTO 2 ELSE PAINT (CVI(MID$(A$, 1, 2)), CVI(MID$(A$, 3, 2))), ASC(MID$(A$, 5, 1))
9  NEXT


- Dav


Last edited by Dav on 29 Jan 2003 19:36; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
BlueKeyboard
Surfing Keyboard


Joined: 19 Apr 2002
Posts: 322

PostPosted: 29 Jan 2003 18:01    Post subject: Re: that's nice. I really ought to improve mine now!! Reply with quote

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

Interesting screensaver Keyboard. But no exit condition? icon_frown.gif

Thx bounce_smile.gif, in the QB IDE just press CTRL+Break.
(But it doesn't work if you compile it).
_________________
Visit Blind Coding
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relsoft
Sanzo


Joined: 05 Nov 2001
Posts: 763
Location: Philippines

PostPosted: 30 Jan 2003 05:31    Post subject: Reply with quote Edit/Delete this post

Wow!!!! These savers a great!!!!

Keep it up!!!

I would prolly post a Plasma when I get to code. Haven't code for 2 weeks 'cept for an hour yesterday.


My plasma would use Sin Additions. ie. Slow as hell

;*)
_________________
Medium or Rare?




Mysite:
Genso' Junkyard
Our game: Frantic Journey

New FJ Screenies:
http://polacka.xepher.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Neo
Neo Deus Ex Machina


Joined: 09 Aug 2002
Posts: 328
Location: The Netherlands

PostPosted: 30 Jan 2003 11:15    Post subject: Reply with quote

I made a plasma background for my NTLOADER.EXE program. (hehe).
_________________
___=== Neo ===___
___=== Deus ===___
___=== Ex ===___
___=== Machina ===___

neo.gif Go for some programming action!

BlindCoding
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Antoni Gual
Forum Regular


Joined: 08 Dec 2002
Posts: 90
Location: Barcelona, Spain

PostPosted: 30 Jan 2003 23:14    Post subject: Reply with quote

Here is my screen saver. See if your eyes can stand it..

Code:

1 SCREEN 13
2 t% = RND * 345
3 WAIT &H3DA, 8
4 FOR i% = 0 TO 199
5 FOR j% = 0 TO 319
6 k% = ((k% + t% XOR j% XOR i%)) AND &HFF
7 PSET (j%, i%), k%
8 NEXT j%, i%
9 IF LEN(INKEY$) THEN END ELSE GOTO 2

_________________
Antoni
Back to top
View user's profile Send private message Visit poster's website
Agamemnus
Guru


Joined: 15 Jan 2003
Posts: 260

PostPosted: 30 Jan 2003 23:53    Post subject: ! Reply with quote

whoah!
_________________
"Life is on the edge of Chaos" -- Carl Sagan
Back to top
View user's profile Send private message Send e-mail AIM Address
Antoni Gual
Forum Regular


Joined: 08 Dec 2002
Posts: 90
Location: Barcelona, Spain

PostPosted: 31 Jan 2003 00:07    Post subject: A more eye-friendly one... Reply with quote

Rel: Can I post more than once?

Code:

1 IF re THEN CLEAR  ELSE SCREEN 13
2 x = RND * 320
3 y = RND * 199
4 im2 = im * im
5 im = 2 * re * im + (y / 100 - 1)
6 re = re * re - im2 + (x / 120 - 1.9)
7 iter% = iter% + 1
8 IF ABS(re) + ABS(im) > 2 OR iter% > 254 THEN PSET (x, y), iter% ELSE GOTO 4
9 IF LEN(INKEY$) = 0 THEN GOTO 1

_________________
Antoni
Back to top
View user's profile Send private message Visit poster's website
wizardlife
Desert Wanderer


Joined: 09 Oct 2001
Posts: 846
Location: Toronto, Canada

PostPosted: 31 Jan 2003 01:25    Post subject: Reply with quote

LooseCaboose wrote:
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


You could lose one line by using poke ($B800) instead of locate, colour, and print...

Oh wait, I'm retarded... you'd still need a def seg... nevermind.
_________________
w i z a r d c o d e o n l i n e
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
wizardlife
Desert Wanderer


Joined: 09 Oct 2001
Posts: 846
Location: Toronto, Canada

PostPosted: 31 Jan 2003 02:40    Post subject: Reply with quote

Okay, here's my (tentative) entry:

Code:

1 RANDOMIZE TIMER
2 DEF SEG = &HB800
3 vars& = 40 + (12 * 256) + (2 * 65536)
4 IF PEEK(((vars& AND 255) + ((vars& \ 256 AND 255) * 80)) * 2) = 32 THEN POKE (((vars& AND 255) + ((vars& \ 256 AND 255) * 80)) * 2), 219 ELSE POKE (((vars& AND 255) + ((vars& \ 256 AND 255) * 80)) * 2), 32
5 IF (vars& \ 65536) = 0 THEN vars& = vars& - 256 ELSE IF (vars& \ 65536) = 1 THEN vars& = vars& + 1 ELSE IF (vars& \ 65536) = 2 THEN vars& = vars& + 256 ELSE vars& = vars& - 1
6 IF (vars& \ 256 AND 255) < 1 THEN vars& = vars& + (65536 + 256) ELSE IF (vars& \ 256 AND 255) > 23 THEN vars& = vars& + (65536 - 256) ELSE IF (vars& AND 255) < 1 THEN vars& = vars& + 65536 + 1 ELSE IF (vars& AND 255) > 78 THEN vars& = vars& +  65536 - 1
7 IF RND > .95 THEN vars& = vars& + 65536
8 IF vars& > 262144 THEN vars& = vars& - 262144
9 IF INKEY$ = "" THEN GOTO 4 'edit d'oh!

Only as interesting as snake savers get... you may have to slow it down a little. I couldn't think of a really foolproof way to do a delay in one line. I could drop the randomize timer and make it square root 79 every cycle or something... but that'd be different on everyone's machine. No colour, couldn't fit it in. icon_cry.gif

edit: notepad pulled a wierd line-wrap thing on me.

edit 2: I renumbered the lines just before I saved and it threw off the GOTO. (After twenty minutes of debugging, do I ever feel sheepish...)
_________________
w i z a r d c o d e o n l i n e


Last edited by wizardlife on 31 Jan 2003 18:09; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
toonski84
I hold this place together


Joined: 31 May 2002
Posts: 977
Location: Melbourne, Florida

PostPosted: 31 Jan 2003 03:07    Post subject: Reply with quote

Code:
1 SCREEN 13
2 FOR x = 0 TO ATN(1) * 8 STEP ATN(1) / 2
3 LINE (160 + COS(a - x) * 70, 100 + SIN(a - x) * 70)-(160 + COS(ATN(1) * 2 + x) * 70, 100 + SIN(ATN(1) * 2 + x) * 70), c MOD 8
4 LINE (160 + COS(a - x) * 50, 100 + SIN(a - x) * 50)-(160 + COS(ATN(1) * 2 + x) * 50, 100 + SIN(ATN(1) * 2 + x) * 50), a MOD 8
5 c = (c + 1) MOD 16
6 a = a - ATN(1) / 90
7 PSET (COS(RND * ATN(1) * 8) * (RND * 30 + 70) + 160, SIN(RND * ATN(1) * 8) * (RND * 30 + 70) + 100), RND * 255
8 NEXT x
9 GOTO 2


seizure-vision. at least on my xp1800. lemme know how it flies on slower cpus.
_________________
D.A.M.M. - Drunks Against Mad Mothers
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Qbasicnews Forum Index -> Challenges All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8
Stop watching this topic
 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum


Powered by phpBB 2.0.4 © 2001, 2002 phpBB Group