Qbasicnews.com
November 16, 2019, 08:35:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 2 [3] 4 5 ... 15
  Print  
Author Topic: Challenge....  (Read 63518 times)
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #30 on: January 31, 2003, 02:51:52 PM »

Code:

1 SCREEN 12
2  v% = RND * 20 + 10
3 REDIM VX%(v%), VY%(v%)
4 FOR d1% = -1 TO v%
5 FOR d2% = d1% + 1 TO v%
6  IF d1% = -1 THEN VX%(d2%) = 320 + (SIN(6.283185 * (d2% / v%)) * 239) ELSE LINE (VX%(d1%), VY%(d1%))-(VX%(d2%), VY%(d2%)), (v% MOD 16) + 1
7  IF d1% = -1 THEN VY%(d2%) = 240 + (COS(6.283185 * (d2% / v%)) * 239)
8 NEXT d2%, d1%
9 IF LEN(INKEY$) = 0 THEN GOTO 2
Logged

Antoni
wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #31 on: January 31, 2003, 03:24:20 PM »

Quote from: "Antoni Gual"
Code:

1 SCREEN 12
2  v% = RND * 20 + 10
3 REDIM VX%(v%), VY%(v%)
4 FOR d1% = -1 TO v%
5 FOR d2% = d1% + 1 TO v%
6  IF d1% = -1 THEN VX%(d2%) = 320 + (SIN(6.283185 * (d2% / v%)) * 239) ELSE LINE (VX%(d1%), VY%(d1%))-(VX%(d2%), VY%(d2%)), (v% MOD 16) + 1
7  IF d1% = -1 THEN VY%(d2%) = 240 + (COS(6.283185 * (d2% / v%)) * 239)
8 NEXT d2%, d1%
9 IF LEN(INKEY$) = 0 THEN GOTO 2

Yikes, it's like spyrograph or something... nice... I need to experiment more with all this trig stuff you guys are pulling.
Logged

wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #32 on: January 31, 2003, 03:55:51 PM »

The standard 'pinwheel':
Code:

1 SCREEN 12
2 FOR colour = 0 TO 15
3 PALETTE colour, colour * 4
4 NEXT
5 angle! = angle! + .1
6 colour = colour + 1
7 IF colour > 15 THEN colour = 0 ELSE IF angle! > 360 THEN angle! = angle! - 360
8 PSET (INT(SIN(angle!) * angle!) + 320, INT(COS(angle!) * angle!) + 240), colour
9 IF INKEY$ = "" THEN GOTO 5

EDIT: There it is with the palette switched.
Logged

wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #33 on: January 31, 2003, 04:06:45 PM »

The non-standard pinwheel:
Code:

1 SCREEN 12
2 FOR colour = 0 TO 15
3 PALETTE colour, colour * 4 * 65536 + (colour * 2)
4 NEXT
5 angle! = angle! + .1
6 colour = colour + 1
7 IF colour > 15 THEN colour = 0 ELSE IF angle! > 360 THEN angle! = angle! - 360
8 PSET (INT(SIN(angle!) * angle! + angle!), INT(COS(angle!) * angle!) + 300), colour
9 IF INKEY$ = "" THEN GOTO 5


edit: just moved it from being centred at 240 to 300 (feels more balanced that way)
Logged

Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #34 on: January 31, 2003, 05:29:29 PM »

This should not be posted here as it's 11 lines but.... Out of contest, off course.


Code:

' cube rotator in 11 lines. From a 19 liner by Entropy, shrinked by Antoni Gual
1 IF x1 = 0 THEN SCREEN 13 ELSE r = (r + .01745) + 6.283185 * (r >= 6.283185)
2  FOR x = -30 TO 30 STEP 10
3    FOR y = -30 TO 30 STEP 10
4      FOR z = -30 TO 30 STEP 10
5        x1 = ((x * COS(r) - (z * COS(r) - y * SIN(r)) * SIN(r)) * COS(r) + (y * COS(r) + z * SIN(r)) * SIN(r)) / (x * SIN(r) + (z * COS(r) - y * SIN(r)) * COS(r) + 100)
6        y1 = ((y * COS(r) + z * SIN(r)) * COS(r) - (x * COS(r) - (z * COS(r) - y * SIN(r)) * SIN(r)) * SIN(r)) / (x * SIN(r) + (z * COS(r) - y * SIN(r)) * COS(r) + 100)
7        PSET ((100 * x1 + 160), (100 * y1 + 100)), 31
8  NEXT z, y, x
9  WAIT &H3DA, 8
10 LINE (99, 39)-(221, 161), 0, BF
11 IF LEN(INKEY$) = 0 THEN GOTO 1
Logged

Antoni
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #35 on: January 31, 2003, 05:48:54 PM »

Wizardlife: Your non-standard pinwheel is the best effect i have seen so far!  Great!
Logged

Antoni
BlueKeyboard
Wandering Guru
***
Posts: 337



WWW
« Reply #36 on: January 31, 2003, 05:51:34 PM »

Lines inside a circle...
Code:

SCREEN 13
DO
WAIT &H3DA, 8
FOR A% = 0 TO 359
PSET (160 + COS(A% * 3.1415 / 180) * 40, 100 + SIN(A% * 3.1415 / 180) * 40), RND
NEXT
A% = INT(RND * 360)
LINE (160 + COS(A% * 3.1415 / 180) * 39, 100 + SIN(A% * 3.1415 / 180) * 39)-(160 + COS((A% + 180) * 3.1415 / 180) * 39, 100 + SIN((A% + 180) * 3.1415 / 180) * 39), INT(RND * 16) + 15
LOOP
Logged

toonski84
__/--\__
*****
Posts: 2567



« Reply #37 on: January 31, 2003, 07:19:26 PM »

well, after that non-standard pinwheel i give up Tongue

that 'seizure vision which is not seizure visions on slow computers' is pretty much a bunch of calculated crap thrown together Smiley
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #38 on: January 31, 2003, 07:31:04 PM »

Here is mine:
Code:

'vortex (Kinda of..) Antoni Gual 2003
1 SCREEN 13
2 OUT &H3C7, 0
3 a$ = a$ + CHR$(INP(&H3C9))
4 CIRCLE (160, 290 - LEN(a$) ^ .79), LEN(a$) / 2.8, LEN(a$) \ 3, , , .5
5 CIRCLE (160, 290 - LEN(a$) ^ .79 + 1), LEN(a$) / 2.8, LEN(a$) \ 3, , , .5
6 IF LEN(a$) < 256 * 3 THEN 3 ELSE OUT &H3C8, 0
7 j = (j + 1) MOD (LEN(a$) - 3)
8 OUT &H3C9, ASC(MID$(a$, j + 1, 1))
9 IF LEN(INKEY$) = 0 THEN 7


 :barf:
Logged

Antoni
wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #39 on: January 31, 2003, 08:58:34 PM »

Quote from: "Antoni Gual"
Wizardlife: Your non-standard pinwheel is the best effect i have seen so far!  Great!


thx. I was trying to dig up all the stuff I made my graphing calculator do in grade 10 when we were supposed to be translating parabolas...

I don't think anyone's going to hit rel's plasma for sheer 'cool' factor, tho.

I really like that falling text one. *runs away to watch the matrix dvd*
Logged

Dav
Administrator
Ancient Guru
*****
Posts: 709



WWW
« Reply #40 on: January 31, 2003, 09:41:56 PM »

Hey, nice posts!  Cool little screen savers.

Here's a mystify-type saver in only 5 lines. (6 if you add the delay)
It's looks like a rainbow wave...

Code:

1   IF r = 0 THEN SCREEN 12 ELSE PRINT
2   a$ = MKI$((160 * COS(r)) + 320) + MKI$((100 * SIN(r)) + 300)
3   IF r > 7.2 THEN r = 1 ELSE r = r + .05
4   LINE (CVI(MID$(a$, 1, 2)), CVI(MID$(a$, 3, 2)))-(CVI(MID$(a$, 1, 2)) + 160 * COS(r), CVI(MID$(a$, 3, 2)) + 45 + r * SIN(r)), r
    '=============
    WAIT &H3DA, 8  'add this if not smooth enough for you
    '=============
5   IF INKEY$ = "" GOTO 1 ELSE END


- Dav
Logged

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



« Reply #41 on: January 31, 2003, 10:51:17 PM »

very nice all, although the plasma one updates too slowly with PSET, and some people still don't have an exit condition. Sad

I bet you could add several of those thingies in one spot with those extra lines (you'd only need 2 more.. FOR I%, NEXT I% (for different line patches), DAV. Smiley
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.
wizardlife
Na_th_an
*****
Posts: 1456


WWW
« Reply #42 on: January 31, 2003, 11:23:56 PM »

Here's to some christmas cheer!
Code:

1 SCREEN 12
2 x% = x% + 1
3 angle! = ATN((SIN(x% / 20) * 20) / x%)
4 dist! = SQR(((SIN(x% / 20) * 20) ^ 2) + (x% ^ 2))
5 PSET ((COS(angle! + y!) * dist!) + 320, (SIN(angle! + y!) * dist!) + 240), INT(y!) AND 7
6 y! = y! + 2
7 IF x% > 300 THEN x% = 0 ELSE y! = y! - 2
8 IF INKEY$ = "" THEN GOTO 2


This could _easily_ be compacted into like 4 lines, but it's slow enough as is... (crawls on my dad's 300 -- okay my 1.6 still, tho...)

Nice one dav!
Logged

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



WWW
« Reply #43 on: February 01, 2003, 01:02:45 AM »

I edited the plasma after seeing that the waves are almost static.

I also added the dynamic translucency....

Code:


'Here's my entry(translucent Plasma!!!)
'I could have made this a lil bit smaller.
'Relsoft
'Note: you may not notice a thing in about 20 secs as its setting
'up the palette.

1 SCREEN 13
2 J& = (J& + 1) AND &H7FFFFFFF
3 IF J& < 257 THEN PALETTE J& - 1, 65536 * INT(32 - 31 * SIN(J& * 3.14151693# / 128)) + 256 * INT(32 - 31 * SIN(J& * 3.14151693# / 64)) + INT(32 - 31 * SIN(J& * 3.14151693# / 32)) ELSE R% = 64 * (((J& AND 1) = 1) OR 1)
4    FOR y% = 0 TO 100
5    FOR x% = 0 TO 160
6            R% = -R%
7            IF J& > 256 THEN PSET (x% + 80, y% + 50), (SIN((x% + R%) / (28)) * 64) + (SIN((x% + R% + (J& MOD 284)) / (45)) * -128) + (SIN((y% + R%) / (16)) * 64)
8    NEXT x%, y%
9   IF INKEY$ = "" THEN 2



Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #44 on: February 01, 2003, 01:12:41 AM »

Some Rects...
Code:


'Nother entry from Rel
1 SCREEN 13
2 Var$ = "" + CHR$(INT(RND * 160)) + CHR$(INT(RND * 100)) + CHR$(INT(RND * 255)) + CHR$(INT(RND * 30)) + CHR$(INT(RND * 50))
3 LINE (ASC(MID$(Var$, 1, 1)), ASC(MID$(Var$, 2, 1)))-STEP(ASC(MID$(Var$, 5, 1)), ASC(MID$(Var$, 4, 1))), ASC(MID$(Var$, 3, 1)), BF
4 LINE (320 - ASC(MID$(Var$, 1, 1)), 200 - ASC(MID$(Var$, 2, 1)))-STEP(-ASC(MID$(Var$, 5, 1)), -ASC(MID$(Var$, 4, 1))), ASC(MID$(Var$, 3, 1)), BF
5 LINE (ASC(MID$(Var$, 1, 1)), 200 - ASC(MID$(Var$, 2, 1)))-STEP(ASC(MID$(Var$, 5, 1)), -ASC(MID$(Var$, 4, 1))), ASC(MID$(Var$, 3, 1)), BF
6 LINE (320 - ASC(MID$(Var$, 1, 1)), ASC(MID$(Var$, 2, 1)))-STEP(-ASC(MID$(Var$, 5, 1)), ASC(MID$(Var$, 4, 1))), ASC(MID$(Var$, 3, 1)), BF
7 IF INKEY$ = "" THEN 2
8 END
9 'Rem Rem Rem Rem




Paint tiling would do wonders!!!!


BTW, I'm collecting the stuff that you're posting and I'll post it on my site along with your names on it.... :*)

Keep it coming guys!!!

Koolness!!!!!
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Pages: 1 2 [3] 4 5 ... 15
  Print  
 
Jump to:  

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