Challenge.... - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html) +--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html) +--- Thread: Challenge.... (/thread-93.html) |
3d rotating cube, in 8 lines, suck this =) - Nexinarus - 02-03-2003 My 3d rotating cube (with bs's help) NOTE: Please copy into notepad and save as a bas file, then load into qb (1.1, 4.5, 7.1, it shouldnt matter). edit: this is the improved version by BinarySHOCK who made it not flicker heh. Code: 1 SCREEN 7, 0, 1, 0 this is the version with no pcopy and is VERY flickery, but 1 line smaller =). Code: 1 SCREEN 13 Pixel Scrolling Pattern - BinarySHOCK - 02-03-2003 umm ya just like it sayz... not very good but i'm bored so ya... 1 SCREEN 13 2 DEFINT A-Z 3 FOR Ix = 0 TO 319 4 FOR Iy = 0 TO 199 5 PSET (Ix, Iy), ((Ix - L) XOR (Iy + L)) * 2 6 NEXT Iy, Ix 7 L = (L + 1) AND 255 8 PALETTE L, (255 - L) \ 4 9 IF INKEY$ = "" THEN 3 Another 1 - BinarySHOCK - 02-03-2003 This 1 looks really stupid for a few seconds until the palette gets fully changed so please wait for that.. 1 SCREEN 13 2 DEFINT A-Z 3 FOR Ix = 0 TO 319 4Â Â Â Â Â Â FOR Iy = 0 TO 199 5Â Â Â Â Â Â Â Â Â Â PSET (Ix, Iy), ((Ix - L) XOR (Iy + L)) Xor ((Ix + L) XOR (Iy - L)) 6Â Â Â Â Â Â NEXT Iy, Ix 7Â Â Â Â Â Â L = (L + 1) AND 255 8Â Â Â Â Â Â PALETTE L, (255 - L) \ 4 9 IF INKEY$ = "" THEN 3 Challenge.... - toonski84 - 02-03-2003 on the contrary, the palette transformation looks pretty cool Challenge.... - Agamemnus - 02-03-2003 Nexinarius, it doesn't paste that because it's above the 256 line limit. :???: Manual copy? (edit) Can you make the sphere bounce around, Rel? You can save 1 line by using a string instead of a variable... You can also save a line by converting the FORs to string addition.. MAYBE. I like dat first one a lot BinaryShock. For the second one the palette transformation is a bit too.. dramatic. I changed it a little, but it's 11 lines. [code] 1 SCREEN 13 2 DEFINT A-Z 3 L = (L + 1) AND 255 4 PALETTE L, (255 - L) \ 4 5 IF L = 0 THEN GOTO 6 ELSE GOTO 3 6 FOR ix = 1 TO 399 7 FOR iy = 1 TO 199 8 PSET (ix, iy), ((ix - L) XOR (iy + L)) XOR ((ix + L) XOR (iy - L)) 9 NEXT iy, ix 10 L = (L + 1) AND 255 11 IF INKEY$ <> "" THEN SCREEN 0 ELSE GOTO 6 [code] Fire, 8 lines - BinarySHOCK - 02-03-2003 1 SCREEN 13 2 FOR Iy% = 199 TO 170 STEP -1 3 IF (POINT(Ix%, Iy%) + POINT(Ix% - 1, Iy%) + POINT(Ix% + 1, Iy%) + POINT(Ix%, Iy% - 1) + POINT(Ix%, Iy% + 1)) > 10 THEN PSET (Ix%, Iy% - 1), (POINT(Ix%, Iy%) + POINT(Ix% - 1, Iy%) + POINT(Ix% + 1, Iy%) + POINT(Ix%, Iy% - 1) + POINT(Ix%, Iy% + 1 _ )) \ 5 - 2 4 NEXT 5 IF INT(RND * 2) = 1 THEN PSET (Ix%, 199), 255 ELSE PSET (Ix%, 199), 0 6 Ix% = (Ix% + 1) MOD 320 7 PALETTE Ix% AND 255, (Ix% AND 255) \ 4 8 IF LEN(INKEY$) = 0 THEN 2 heh incase you didn't kno, all that point stuff needs to be on 1 line if you remove the PALETTE it would be in 7, but then it looks kinda umm ya not like fire. thank you, agamenus. Challenge.... - Dav - 02-03-2003 Had some more time to waste and make something. I'm not sure where I got the idea for this one. It's nothing special -- but I did try to avoid the so called cheap hacks for once. Makes it more challenging(sic?) to come up with something decent. A rainbow-paint-spray-runner-type of thing... Code: 1 SCREEN 13 Challenge.... - Nexinarus - 02-03-2003 Ok, Agamemnus, try: -copying the text to windows clipboard -paste it into notepad and save as a bas file -now it should run fine, i just tested it on qb4.5 and it worked. (yea the lines are massive lol, its the only way i could think of :p Challenge.... - Antoni Gual - 02-04-2003 Binary Shock: Fine XOR effects! The second one is just incredible! Rel: Incedible sphere! Do you really have a raycaster in 13 lines? Post it please...... Dav: I like these "handcrafted" textures. A very fine effect Generic: Excuse me, i could not resist the temptation Code: ' OPTIMIZED :) rotozoomer in 9 lines by Antoni Gual Am I becoming blind? - Antoni Gual - 02-04-2003 Is Rel's sphere program is hiding points in the back face?...:o Ok, I think we should all give up... You are the winner, Rel! But I will continue sending progs just for fun! :bounce: |