Qbasicnews.com
October 25, 2020, 07:17:59 PM
 Welcome, Guest. Please login or register. 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length
 Home Help Search Login Register
 Pages: 1 [2]
 Author Topic: Serious challenge: Graphics demo within 25 LINES OR FEWER!  (Read 11873 times)
relsoft
*/-\*

Posts: 3927

 « Reply #15 on: July 08, 2003, 03:50:04 AM »

Yeah, @#\$% happens....

Blame Photoshop!!!!
 Logged

y smiley is 24 bit.

Genso's Junkyard:
http://rel.betterwebber.com/
Mango
Wandering Guru

Posts: 360

 « Reply #16 on: July 09, 2003, 12:28:07 AM »

To clairify...if I use TYPE/END TYPE, it is illegal to have line numbers for any of it but the TYPE statement.  For example,
Code:
1 TYPE j
x AS INTEGER
y AS INTEGER
z AS INTEGER
END TYPE

is legal, but
Code:
1 TYPE j
2 x AS INTEGER
3 y AS INTEGER
4 z AS INTEGER
5 END TYPE

is illegal...therefore, can the whole type statement be counted as one line?  Also, am I correct in assuming that sticking lines together with colons doesn't count?
 Logged
oracle
*/-\*

Posts: 3652

 « Reply #17 on: July 09, 2003, 01:07:15 AM »

I think people just use the line numbers to make counting easier... and no, you cannot colon-join. (I know this is not my challenge, but it's common sense).
 Logged

Mango
Wandering Guru

Posts: 360

 « Reply #18 on: July 09, 2003, 02:41:43 AM »

Code:
'This is my starfield entry hacked down to 25 lines
'It needs a pretty fast computer...looks OK on my 1.5 GHz
'JKC 2003

1 TYPE star
x AS INTEGER
y AS INTEGER
z AS INTEGER
END TYPE
6 DIM astar(0 TO 300) AS star
7 DIM oldstar(0 TO 300) AS star
8 FOR i = 0 TO 300
9  astar(i).x = RND * 640
10  astar(i).y = RND * 480
11  astar(i).z = RND * 300
12 NEXT i
13 SCREEN 11
14 DO
15 FOR i = 0 TO 300
16   IF astar(i).z < 1 THEN astar(i).z = 300 ELSE astar(i).z = astar(i).z - 1
17   FOR p% = 0 TO oldstar(i).z
18     CIRCLE (oldstar(i).x, oldstar(i).y), p%, 0
19     IF astar(i).z <> 300 THEN CIRCLE (INT(2 * astar(i).z + astar(i).x / (1 + astar(i).z / 30)), INT(astar(i).z + astar(i).y / (1 + astar(i).z / 30))), p%
20   NEXT p%
21   oldstar(i).x = INT(2 * astar(i).z + astar(i).x / (1 + astar(i).z / 30))
22   oldstar(i).y = INT(astar(i).z + astar(i).y / (1 + astar(i).z / 30))
23   oldstar(i).z = 5 / (1 + astar(i).z / 20)
24 NEXT i
25 LOOP UNTIL INKEY\$ <> ""

sorry for regurgit :barf: ting some code I wrote for another challenge
 Logged
Sterling Christensen
Na_th_an

Posts: 1328

 « Reply #19 on: July 09, 2003, 05:10:25 AM »

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.
 Logged
Ancient Guru

Posts: 691

 « Reply #20 on: July 17, 2003, 02:41:38 AM »

To Na_th_an,

To Richard Eric M. Lope,

Within your series of 25-line based graphics demos, you sure fire off some **OUTSTANDINGLY GOOD** practice shots, man, to be 100% brutally honest with you!!!   !!!  Your 25-line plasma demo, is knock-out AWESOMELY ORIGINAL, and when I have compiled it to .EXE and ran it, it ran at a WHOPPING 60+ FPS on a Pionex 450mhz Pentium III computer that I already have!!!    :cool: !!  And, your 25-line water simulation program sure is a _really_ good one, with your 25-line water simulation with texture mapping sure TAKING THE ENTIRE CAKE when it largely comes to how ***flat-out excellent*** your demos really plain are!!!  YOU HAVE THE MOST SPECTACULARLY SPLENDID POTENTIAL TO WIN GRAND PRIZE AT MY COMPO, so if you are all set for an invitation to my compo, gear up and get ready to go!!!  (Just remember to please review the Official Rules of my compo and agree to all of them before even signing up for an invitation, with which you can truly begin entering!    The same is true for ANYONE that wants to join in, too.)

To Mango,

Hello and what an **absolute** pleasure for me to talk to you for the very first time!!  God bless you ever so richly, man!   !  Look now, as for your practice entry which is your 25-line starfield demo, notice the part of the QuickBASIC code you put down:

Code:
1 TYPE star
x AS INTEGER
y AS INTEGER
z AS INTEGER
END TYPE

Believe it or not, *that* counts as five (5) consecutive lines in a row, HOWEVER, since the rest of your code comprises of this:

Code:
6 DIM astar(0 TO 300) AS star
7 DIM oldstar(0 TO 300) AS star
8 FOR i = 0 TO 300
9  astar(i).x = RND * 640
10  astar(i).y = RND * 480
11  astar(i).z = RND * 300
12 NEXT i
13 SCREEN 11
14 DO
15 FOR i = 0 TO 300
16   IF astar(i).z < 1 THEN astar(i).z = 300 ELSE astar(i).z = astar(i).z - 1
17   FOR p% = 0 TO oldstar(i).z
18     CIRCLE (oldstar(i).x, oldstar(i).y), p%, 0
19     IF astar(i).z <> 300 THEN CIRCLE (INT(2 * astar(i).z + astar(i).x / (1 + astar(i).z / 30)), INT(astar(i).z + astar(i).y / (1 + astar(i).z / 30))), p%
20   NEXT p%
21   oldstar(i).x = INT(2 * astar(i).z + astar(i).x / (1 + astar(i).z / 30))
22   oldstar(i).y = INT(astar(i).z + astar(i).y / (1 + astar(i).z / 30))
23   oldstar(i).z = 5 / (1 + astar(i).z / 20)
24 NEXT i
25 LOOP UNTIL INKEY\$ <> ""

..............now THAT is a **rather AMAZINGLY clever** ( ) strategy that _could_ help you nab a *SURE* shot at the Grand Prize at my compo, so utterly splendid good fortune to you on your newest entry, Mango, should you choose to have an invitation all set up for my QB event that’s currently going on right now!!!    Going back to your practice demo, it is **truly** freshly good and original (and even runs real well compiled, too!), as this is the kind of stuff that we want to see some more of in 25-line (or fewer-line-based) graphic demos that are created using QuickBASIC!  Excellent work, man!!     !

And to Sterling Christensen,

Hello to you again and thank you so much for your very good post!  Long time, no see, man!!   !  Listen, your graphics demo that you have most recently posted from yesterday is indeed only 23 lines long just like you have already said, and I must go to great lengths to believe that that is some *REAL IMPRESSIVE* color show you sure put on in your tile-based graphics demo to the tune of fading red, white, and blue colors (can you say, “America, the beautiful”, people?  :rotfl: ).  For a 25-line (or fewer-line based) graphics demo, that is a pretty awesome practice run from you, Sterling.  You got some **real good** potential going in you to prepare a new, mind-blowing QB demo that can _hopefully_ win you the Grand Prize at my compo, should you choose to get yourself a invitation as well, so I wish you REAL well on it!!!   !  And by the way, according to my requirements, you are rather fortunate, man, ‘cause there is *NO* such rule that says that “DEF fn” commands are not allowed in your program.  Therefore I WILL allow the “DEF fn” commands to be used in these types of programs!!  Period, point-blank end of the conversation.   !  All SUBs and FUNCTIONs, though, are completely disallowed.  EVER.

And to the rest of the QB45/QB71 community (with just a few more words to say to Na_th_an, Eric, Mango, and Sterling!  ;*) )

I want to remind you all that once you do get an invitation to my compo (which is found on my Official Rules page), you can choose any one of the seven categories.  If you enter and choose “Graphics Demo within 25 LINES OR FEWER!”, then you must follow the requirements given to you for that category, and you must also make your entry a new pure-QuickBASIC graphics demo from scratch, okay now please?  Man, I just hope to see you win big at this even *grander* QB gala, so ***MOST EXCELLENT FRESH, NEW, AND INSPIRINGLY ORIGINAL CODING IN QUICKBASIC TO YOU ALL***, and God’s massive fiery blessing to you all!!!  See you all again later!!     !!

PROVIDING YOU ALL SOME AMAZINGLY _RICHEST_ ENCOURAGEMENT AND THEN PLENTY,

One of the Founders of “Aura Flow
Webmaster of the AAP Official Homepage
Official Founder of the “QuickBASIC Caliber Programming Compo
 Logged

url=http://dhost.hopto.org/aapproj/][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!   !
relsoft
*/-\*

Posts: 3927

 « Reply #21 on: July 17, 2003, 03:14:13 AM »

;*)
 Logged

y smiley is 24 bit.

Genso's Junkyard:
http://rel.betterwebber.com/
na_th_an
*/-\*

Posts: 8244

 « Reply #22 on: July 17, 2003, 05:09:30 AM »

Thanks for your comments, my friend. I'll try to put something together that is suited to your compo rules
 Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Ancient Guru

Posts: 691

 « Reply #23 on: July 31, 2003, 10:35:34 PM »

Most __VASTLY__ dearest QB45/QB71 community,

Greetings to you all again!!!   !  For those of you who have already pasted your practice shots pertaining to the “Graphics Demo within 25 LINES OR FEWER!”  thing — with of course the total number of lines (not counting remark-based ones) in your code amounting to indeed 25 or fewer — you can *now* see them for ALL of the QuickBASIC programmers from __around the whole ENTIRE globe__ to see and even be **so** amazed and fascinated by, and it all begins by clicking here right now please!   !

Thank you so much and GOOD UTTER FORTUNE TO YOU ON MY COMPO, should you choose to accept the invitation!!!  :cool: !!

GIVING YOU SOME **REAL EXCELLENT** ENCOURAGEMENT HERE,

One of the Founders of “Aura Flow
Webmaster of the AAP Official Homepage
Official Founder of the “QuickBASIC Caliber Programming Compo
 Logged

url=http://dhost.hopto.org/aapproj/][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!   !
relsoft
*/-\*

Posts: 3927

 « Reply #24 on: August 01, 2003, 03:53:35 AM »

so I take it as the entries here are already in the compo?

if not....  Let's see if I could get that mode7 plasma in 25 lines.....
 Logged

y smiley is 24 bit.

Genso's Junkyard:
http://rel.betterwebber.com/
Ancient Guru

Posts: 691

 « Reply #25 on: August 01, 2003, 01:44:19 PM »

To Richard Eric M. Lope,

Actually, they are *not* really entries at all.  They are only practice shots for people like you to see and be inspired by, and that is _exactly_ why they were just placed up there from yesterday, my man!  :cool:

However though, if you want to make your _latest_ 25-line (or less!) graphics demo as your *official* entry, you must first of all read the newly revised and updated Official Rules of my compo *very* carefully and agree to them all before you even sign up for an invitation to allow you to do such a project as that, alright please Eric?

And, BEST OF SUCH ***RATHER*** SPLENDID QB CODING TO YOU AND THE WHOLE QB45/QB71 COMMUNITY TOO, my deepest friend!!!   !!

LOVE SO VITALLY WITH __ALL__ OF MY HEART,

One of the Founders of “Aura Flow
Webmaster of the AAP Official Homepage
Official Founder of the “QuickBASIC Caliber Programming Compo
 Logged

url=http://dhost.hopto.org/aapproj/][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!   !
 Pages: 1 [2]