200byteDemoChallenge!

BlitzMax Forums/BlitzMax Programming/200byteDemoChallenge!

Chris C(Posted 2007) [#1]
edit: ekk! the titles wrong! 250 (255 if you must!) not 200!!!

heres the rules

your source code cannot exceed 250 bytes
it can only use standard brl and pub modules
it should not be OS specific
your demo can not load or otherwise download media

heres my submission (should be easy to beat!)

Graphics 640,480;b=999;d#=24;h=16;For n#= 0 To b;d:*.997;Plot h+d*Sin(n),h+d*Cos(n);Next;p=grabpixmap(0,0,32,32);h:*3;While 1;cls;o:+1;d=400;for l=o to o+b+b step 40;d:*.99;drawpixmap p,h+d*cos(l),h+d*sin(l*1.2);next;flip;Wend


on a single line it comes to 226 bytes


JazzieB(Posted 2007) [#2]
Nice.

Here's another rule though ... you should be able to quit the program by hitting Esc!

Sorry, don't have time to come up with anything myself at the moment.


amonite(Posted 2007) [#3]
nice demo Chris !
here is my attempt :
Graphics 320,240;Function P(x,y,r);SetColor r,g,b;Plot x,y;EndFunction;Repeat;SetClsColor 50,50,50;Cls;For x = 0 To 320-1 Step 4;For y = 0 To 240-1 Step 4;P(Rand(320),Rand(240),Rand(240));Next;Next;Flip;If KeyHit(KEY_ESCAPE) Exit
Forever


240 bytes

edit:
removed the function.
Graphics 320,240;Repeat;SetClsColor 50,50,50;Cls;For x = 0 To 320-1 Step 4;For y = 0 To 240-1 Step 4;SetColor Rand(250),255,255;Plot Rand(320),Rand(240);Next;Next;Flip;If KeyHit(KEY_ESCAPE) Exit
Forever


205 bytes

edit:
(sorry for editting so much)
slightly different effect :)
Graphics 320,240;Repeat;angle=Rand(360);SetClsColor 50,50,50;Cls;For x = 0 To 320-1 Step 4;For y = 0 To 240-1 Step 4;SetColor Rand(250),255,255;Plot x+Cos(angle)*10,y+Sin(angle)*10;Next;Next;Flip;If KeyHit(KEY_ESCAPE) Exit
Forever


233 bytes


Chris C(Posted 2007) [#4]
hey Benyboy I like it if you stare closely enough you can see those images just leaping out at you, well done!


Damien Sturdy(Posted 2007) [#5]
mine:

232 bytes

Graphics 640,480Repeat;o=320;p=240For i#=0 To 360f#=Sin(i)*128For x#=0 To 8 Step .04b#=(x^2)-64a#=((8-x)^2)-64For e=a To -a;c#=Rnd(e+f+(b*(b*0.01)))*8SetColor 64-c,c,c;Plot o+e,p+b;Plot o+e,p-b;Next;Next;Flip;Next;Until Keyhit(27)


[edit] I put it in a codebox to stop it cocking up the window.

[edit2]

screw the window

[edit3]

Hit escape and it will quit after the next cycle.


Chris C(Posted 2007) [#6]
now thats just awesome!!!

will someone beat the winning entry off its top spot?


Damien Sturdy(Posted 2007) [#7]
I updated it. 248 bytes,and it enters and exits eclipse correctly.

Graphics 640,480Repeat;o=320;p=240For i#=0To 360f#=Sin(i)*128s=Sgn(Cos(i))For x#=0To 8Step .04b#=(x^2)-64a#=((8-x)^2)-64For e=a To -a;c#=Rnd((e/2)+f+(b*(b/400)))*6SetColor 64-c,c,c;Plot o+e*s,p+b;Plot o+e*s,p-b;Next;Next;Flip;Next;Until Keyhit(27)



Mikele(Posted 2007) [#8]
Graphics 320,200s=4
While Not KeyDown(9)
Cls;amp=amp+s;If Abs amp>99 s=-s
For x=0 To 360For l=1 To Abs amp;SetColor amp,l,l;Plot x/360.0*319,100-l+Sin(x)*amp/l;SetColor l,l,-amp;Plot x/360.0*319,101+l+Sin(x)*amp/l;Next;Next;Flip
Wend


237 b but effect is very simple :). Press TAB to exit.


Derron(Posted 2007) [#9]
Graphics 640,480;For i=1 To 30;j=i*8;SetColor j*2,j,j*0.8;DrawOval(i,i,20-i,20-i);Plot(Rand(10),Rand(10));Next;p=GrabPixmap(0,0,64,64);Repeat;Cls;For j=1 To 8;DrawPixmap(p,k*j,l+40*j);k:+1;k:Mod 640;l=k*1.1;Next;Flip;Until KeyHit(27)



235 Bytes... removing the grabpixmap and drawing the ovals each loop could decrease it to 200Bytes...but somehow it doesn't display the moving ovals when using the x,y-coordinates of the drawpixmap-command.

What is shown: asteroids/burning cannonballs... what you may imagine ;D
Changing the first for-loop-value changes the look... so also "rockets" are possible.

If one wants... change the code so Pixmap is exchanged with dynamical drawn Ovals...so it would be possible to "animate" the particles of the flame (the plot-command).


bye
MB


Tachyon(Posted 2007) [#10]
Graphics 640,480;Repeat;c:+10;Cls;For a=0 To 480;For b=0 To 640;Plot b*a-c,a;Plot 640-b*a+c,a;Next;Next;Flip;Until KeyHit(KEY_ESCAPE)

Prepare yourself for face-melting Virtual Reality(tm) graphics so real you'll swear you are straped to a TRON Light Cycle battling for your life against the MCP!

135 bytes (enough room left to add a Disc battle sequence as well!)


Chris C(Posted 2007) [#11]
@Mikele thanks nice, but I think I'm going to be sick now, great coding!

@MichaelB Impressive ball of fire! (or was that steel) :o)

@Tachyon the fewest bytes! absolutly gridtastic


Theres some seriously creative stuff and fun too! way to go guys!


Zenn Lee(Posted 2007) [#12]
Wow Tachyon, real nice.


CS_TBL(Posted 2007) [#13]



Scaremonger(Posted 2007) [#14]
There is some cool work here, but I've got the first shoot-em-up in 250 bytes exactly. (It even has a scoring mechanism)

w=200;Graphics w,99;Repeat;Cls;DrawText(s,0,0);If KeyDown(39)p:+2
If KeyDown(37)p:-2
If KeyHit(32)x=p;y=95
a:+1;a:Mod w;DrawText("O",a,9);DrawText("-",p,90);If y DrawText("!",x,y);y:-5;If y<9And x<=a+4And x>=a-4 s:+1;a=0;y=0
Flip;Until KeyHit(27)


Use cursors for left and right. Space to fire, escape to exit.


SpaceAce(Posted 2007) [#15]
Scaremonger, that is some excellent work. Very well done.

SpaceAce


Damien Sturdy(Posted 2007) [#16]
Have I been knocked off? I don't have Max here so I can't see the cool stuff!!!! :)


CS_TBL(Posted 2007) [#17]
forget it guyz, here's teh 1337 winner :P




Chris C(Posted 2007) [#18]
@CS_TBL nice cool effect and the scroller wasn't bad too!

BUT Scaremonger a whole game in 250 bytes I'm never touching sauerbraten again...

The field is getting red hot! OH my god I may pass out with all the excitement

I cant decide who's in the lead, can you tell?


CS_TBL(Posted 2007) [#19]
btw, do enters count as source-byte? (having soft-return means at least one extra byte (chr13) perhaps two in case of chr13+chr10 ..


Damien Sturdy(Posted 2007) [#20]
i'm gonna make another entry later then. :P
[edit]

With what CS_TBL just said:

Enter should be worth 1 char, otherwise using multiple lines gives you an advantage in some cases where ;'s are required on single line code.

In my case, I just miss out all the ;s.

I dont mind either way, but to me it all means "do it on one line" because these compo's have traditionaly been so :)


Damien Sturdy(Posted 2007) [#21]
Woah, nice work guys!!! :D


Scaremonger(Posted 2007) [#22]
When I created mine I removed as many CRLF as I could because they use two bytes, and a semicolon takes one.

I take my file size from windows which includes all the padding.

PS. Don't press return at the end of a line in the IDE cos it formats it with loads of spaces.

PPS. Not all semicolons are needed.


Chris C(Posted 2007) [#23]
As far as I see it, if it works and the actual file
size is <250 bytes then if it has ;'s hard or soft porn errm I mean returns it don't matter.

To be honest it needn't even exit!

(theres a close gadget on the corner of the window anyhow, but no being able to quit is irrelevant to fantastic effects we're enjoying here!)

I keep having this mental image of Mark Sibly looking at these ugly sources all on one line, shaking his head and crying "what are these horrid people doing to my beautiful language"


CS_TBL(Posted 2007) [#24]
The fact that you can put a command directly after a value (like: for a=0 to 40print a) does make for obfuscation.. :P What's killing for these challenges is the sometimes large commands. Replacing an instruction for a code would be so nice ^_^


CodeGit(Posted 2007) [#25]
This is all cool stuff, imagine if we changed the rules to 1k (1024 bytes) ;) just a thought.


QuietBloke(Posted 2007) [#26]
I had a bit of spare time last night so I went through all the entries last night and whooo... impressive!.. especially as some even include a comment!

If I had to vote I think I would say CS_TBL wins ( so far ) ... only because I wouldnt know how to write it no matter how big my source code is!


Scaremonger(Posted 2007) [#27]
Here's another one...

Tron light cycles in 240 bytes. Cursors to control, Esc to exit. If you hit your trail you die.

a=640b=480h=1x=b/2y=x;Graphics a,b;Repeat;If KeyDown(37)h=-1v=0
If KeyDown(38)v=-1h=0
If KeyDown(39)h=1v=0
If KeyDown(40)v=1h=0
x:+h+a;y:+v+b;x:Mod a;y:Mod b;i=GrabPixmap(x,y,1,1)Plot(x,y)p=ReadPixel(i,0,0)Flip;Until p=-1Or KeyHit(27)



Scaremonger(Posted 2007) [#28]
Or a 162 byte colour box...

w=255Graphics w,w;Repeat;z:Mod w*2Cls;For y=0To 255For x=0To 255SetColor(Abs(x*2-w),Abs(y*2-w),Abs(z*2-w))Plot(x,y)If KeyDown(27)End
Next;Next;Flip;z:+5Forever



Scaremonger(Posted 2007) [#29]
And my last one.... (I promise)...

Avoid the Asteroids in 243 bytes. (Cursors up/down). Final score is given in output at the end.

w=200h=96p=5Graphics w,h;Repeat;Cls;DrawText("Score:"+s,0,0)p:+(1And KeyDown(40))-(1And KeyDown(38))DrawText(">",0,p*8)x:-1y:+Rand(-1,1)If x<0x=25y=Rand(12)s:+1
DrawText("O",x*8,y*8)Flip;Until(x=0 And y=p)Or KeyHit(27)Print "Score:"+s



doswelk(Posted 2007) [#30]
@Code Git

Yesterday Scaremonger and I were discussing just that!

We were remembering the ZX81 (a 1K computer for you non-brits) and how there used to be games that would run in that!

Maybe that should be a seperate challenge?

(Now I know the complied code would be more that 1K, but the source code would not be)


Scaremonger(Posted 2007) [#31]
The ZX81 used interpreted basic and your code, variables and screen RAM fitted into 1K.

Maybe the next challenge should be a game in the smallest possible compiled code... Say 10 Kilobytes!

I doubt a 1K (compiled) game would be possible, because the 243 byte tron (above) compiles into 4394 bytes.

I'd give a 1K (source) game a go...


CS_TBL(Posted 2007) [#32]



CS_TBL(Posted 2007) [#33]
I feel more for a 512byte source compo orso .. :P

Stuff like Graphics 320,240 eats away 16 precious bytes already, and since BMax Line became DrawLine, Rect became DrawRect etc., so it's really some of these long functions that kill the potention.


Koriolis(Posted 2007) [#34]
Here's my entry. It's a StarWars-ish scrolling.



Run it with the following command line argument:
" Once upon a time in a galaxy far far away ..." (copy and paste, WITH quotes).
EDIT: I just figured that HTML would make series of spaces become a single space, so the text you see is wrong, and become badly aligned. The right text was:
"_Once___upon____a_time__in___a__galaxy__far_far__away_____..."

Just replace the underscores ith spaces.

(255 if you must!)
That's fortunate because my entry is exactly 255 bytes :)
Though if you don't mind having the text in pure white rather than yellow you can remove the call to SetColor.


H&K(Posted 2007) [#35]
Ive posted this before, but as there seems to be a new surge of activity Ill post it again
TGC have a whole thread board set aside for this
1) A line is defined as a line of text, terminated with a carriage return.
2) You can stack multiple commands per line up to a maximum of 25 commands per line.
3) External media is allowed but must be supplied for download or your post will be deleted.
4) External media cannot be larger than 200k in size UNCOMPRESSED.
5) State in the subject or body of the post if it's a DB or DBPro program (or both)
6) Lines with comments (remarks) on are not included in the 20 line maximum and are encouraged to help others understand your code
7) You are free to use blank lines to space out your code for readability, they are not included in the 20 line maximum. The second a line has a command on it it's included.

Basicly it comes down to write a Game with only 500 commands. I think it would be a good idea to have such a continuious comp/board going here. (And making it 500 commands means that Line or drawline or screen.draw.line would count as the same.


Chris C(Posted 2007) [#36]
Its a real shame Linux didnt like AppArgs[1] but I love the starwars effect neat!

that color box makes me feel all warm and fuzzy, and is *almost* beaten by the jelly lines

the 250 byte rule is only to cause a challenge for peoples creativity to work against as is the no media and as such you can see from the stunning effects they work.

I think a 8192 byte compiled all media included demo challenge would be an equal challenge, I'd suggest that the first person who can come up with an example should post the challenge.

By preference I'd say that all media must be creatable by a separate chunk of code, that way as long as the text of the thread is accessible the media always will be too...

and I think we should have a whip round for Scaremonger whos obviously suffering withdrawl symptoms (btw there's a java zx81 emulator floating round that's basically a 1:1 representation)


Koriolis(Posted 2007) [#37]
Another entry (EPILEPTIC PEOPLE: do not try! You're warned :) )

(253 bytes).


CS_TBL(Posted 2007) [#38]
eek, neat!

Actually, I was searching the net for pseudo-code for all these classic demoscene effects for my own under-construction script-based texture generator. There's not much to find tho. I'm looking for stuff like drawing filled triangles -antialiased-, mapping a texture of any size onto a tunnel, mapping a texture of any size onto a sphere, make a phongshaded sphere, etc. etc. those kinda things.. a lot of the rest I already have. :P

Are there any links with pseudocode for all kinda classic 2d and semi-3d effects? (not just pages explaining effects visually, or in context of some modellere, but really with understandable pseudocode)


Chris C(Posted 2007) [#39]
@koriolis thats seriously nice looking! is it a kinda koriolis effect (boom tish)


Koriolis(Posted 2007) [#40]
eek, neat!
Thanks. I loved your last entry, this is my favorite so far.

is it a kinda koriolis effect (boom tish)

Precisely :) Actually I adpated it from some script I wrote to generate swirls. I'm gonna use one of them as a logo ;)


Chris C(Posted 2007) [#41]
using the Cygnus patented "who needs ;'s anyhow" technique I got it down to 250 bytes!!!!

a#=257;Graphics a,a;a:/2;SetOrigin a,a;While 1;j#=Sin(t*3)k#=Cos(t*7)l#=Sin(t*5)For x=-a To a;For y=-a To a;u#=x/a;v#=y/a;i#=Sin((ATan2(u,v)+Sin((u*u+v*v)^l)*a*a*k)*Int(j*50))+1SetColor i*(j+1)*a,i*(k+1)*a,i*(l+1)*a;Plot x,y;Next;Next;t:+1Flip;Wend



Damien Sturdy(Posted 2007) [#42]
I have another bit of code. Koriolis reminded me of a bit of Logo code I wrote and I wondered what it would look like animated at more than 0.5fps :)


MY CODE:
Graphics 640,480b#=0d#=128Repeat;x#=320y#=240;o=x;p=y;a#=-b*5For c#=1To 750;e#=Sin(c+b*30)SetColor d+e*d,d+Cos(c+b*30)*d,d-e*d;DrawLine o,p,x,y;o=x;p=y;x=x+Sin(a)*c;y=y+Cos(a)*c;a=a+90+Sin(b);b=b+.01Next;b=b-7.4Flip;Cls;Until KeyDown(27)



[edit]

Koriolis, I got yours down to 247:

a#=257Graphics a,a;a:/2SetOrigin a,a;While 1j#=Sin(t*3)k#=Cos(t*7)l#=Sin(t*5)For x=-a To a;For y=-a To a;u#=x/a;v#=y/a;i#=Sin((ATan2(u,v)+Sin((u*u+v*v)^l)*a*a*k)*Int(j*50))+1SetColor i*(j+1)*a,i*(k+1)*a,i*(l+1)*a;Plot x,y;Next;Next;t:+1Flip;Wend



SpaceAce(Posted 2007) [#43]
This thread would be so much more awesome if people posted commented versions of their submissions. Not everyone can understand at a glance that you're incrementing X each loop because of the effect it has on your Sin() and Cos() functions, or why you're multiplying it by 128 to set colors and so on. This thread could be fun AND educational. I encourage everyone with a couple of extra minutes to go back and comment your code.

SpaceAce


impixi(Posted 2007) [#44]
H&K,

I'd be more inclined to participate in something like this:

* Create an arcade/action game using only the BRL.GLMax2D framework, and no external media files, that has a nodebug EXE compile <256KB.

But in principle I agree that having an ongoing forum or thread dedicated to these types of challenges is a good idea: they’re fun and beneficial to the community.


CS_TBL(Posted 2007) [#45]
And now.. for something completely different..



Chris C(Posted 2007) [#46]
LMAO nice one! .? :) :P !!!

there is one problem with EXE < 256kb (apart from being not a very challenging size) and that that linux exe's are different sized and mac apps are sub directories and I'll bet differently sized to either

At least by limiting source size, each platform is the same

By saying no media then as long as this thread is accessible then the apps can be tested (even if some remote d/load site no longer exists)

1/2 of the fun (at least for me) has been picking apart the code to see just how it does what it does!

If someone wants different rules then its a different challenge, make your challenge app and post a thread!...

(just dont make it tooo easy or its no fun)


Koriolis(Posted 2007) [#47]
BTW I updated my first post (about the star wars scrolling) because the text you need to put on the command line was not showing correctly on the forum.


Grey Alien(Posted 2007) [#48]
Wow, can't believe I missed this thread. Excellent work all round guys. Scrollers, sine stuff, mini games - cool!

I think I like Koriolis's best but it's hard to say :-)


CS_TBL(Posted 2007) [#49]



Chris C(Posted 2007) [#50]
standing ovation !!!

I think its between this and the koriolis effect...


CS_TBL(Posted 2007) [#51]
Next challenge should be 640bytes, with as subtitle: '640 bytes ought to be enough for everyone' ^_^
(when does this chal. end, btw?)


CS_TBL(Posted 2007) [#52]
ooh, more .. ;P



Grey Alien(Posted 2007) [#53]
http://en.wikiquote.org/wiki/Bill_Gates

Apparently he never said that (well about 640KB not Bytes of course)


Chris C(Posted 2007) [#54]
Thats neat CS_TBL! but it still doesnt beat your leading entry.

I think the compo should end soon, so get your entry in if you think you have the skillz to beat l33t CS_TBL!!!


Matt Merkulov(Posted 2007) [#55]
Graphics 800,600;p=CreatePixmap(800,600,4);For y=1 To 599;For x=1 To 799;WritePixel p,x,y,(((ReadPixel(p,x-1,y)&$FF)+(ReadPixel(p,x,y-1)&$FF)) Shr 1+Rand(0,5))*$10101|$11000000;Next;Next;DrawPixmap p,0,0;Flip;WaitKey
217B


Chris C(Posted 2007) [#56]
ohh... that, well interesting! amazing what can be done, I'll have to leave this open another day just in case something nice like this comes in


amonite(Posted 2007) [#57]
The challenge has come with such amazing entries i decided to put together a small web page to preserve the thread in case it vanishes.
http://perso.orange.fr/amagumo/255BDC.html
Ahah Chris, i guess you didn't expect so many people would take place in your challenge :)

edit: CS_TBL didn't like the blue background, so changed it to
more classic white background.


CS_TBL(Posted 2007) [#58]
nice ^_^

But uhm.. really.. narrow black font on pure blue? :P


Scaremonger(Posted 2007) [#59]
My vote goes to cygnus' logo code or CS_TBL's organs ...

Excellent stuff...


altitudems(Posted 2007) [#60]
Great stuff so far!
I was trying to get a breakout clone, I failed. 253 Bytes. Arrow Keys.



altitudems(Posted 2007) [#61]
Ok, this one is way better, a Frogger clone in 246b! Use the left and right to control the frog, you have ten lives can you make it back and forth?



Edit:
New version with scoring and escape key just use the right arrow this time. 255 bytes!



Chris C(Posted 2007) [#62]
YaY! way to go, but lets *NOT* start posting our hi-scores eh guys?! :D


QuietBloke(Posted 2007) [#63]
This is all pretty much done now but I thought I would add my spinning ball thing... Im not very good at this so im afraid its complete bloatware at 252 bytes but hey.. at least I managed to get something !

ESC- To quit.

w=320;h=240;r=90Graphics w,h;w:/2;h:/2;s=0;a=45While Not KeyHit(27);Cls;For x=0To 360Plot w+r*Cos(x), h+r*Sin(x)
For y=0To a Step 45If x<180 Plot w+(r-y+s-a)*Sin(x),h+r*Cos(x)Else Plot w+(r-y-s)*Sin(x),h+r*Cos(x);
Next;Next;s:+1If s>a s=0
Flip
Wend



altitudems(Posted 2007) [#64]
Nice, I like it! Keep it going guys this is addicting.


QuietBloke(Posted 2007) [#65]
Now I finally found some time to give this a go... I find it addictive !

OK.. so another entry... this one could be much smaller but I left it as is as its more readable...

A parallax scrolling starfield.\ESC - Quit

244 bytes.

w=320;h=240;Graphics w,h
d=0
While Not KeyHit(27)
	Cls
	SeedRnd(1)
	For s=0 To 200
		x=Rnd(0,w)
		If s > 100 m=2 Else m=1
		y=Rnd(0,h)+d*m
		If y > h Then y:-h
		Plot x,y
		If m=2 Plot x,y-h
	Next
d:+1
If d>h Then d=0
	Flip
Wend



Chris C(Posted 2007) [#66]
thats a nice starfield, and trying to condense it shows off the if then ; bug quite well...


QuietBloke(Posted 2007) [#67]
thanx... so ermm.. what is the if then bug ?


I looked back on my code and it is a little inconsistent in that I didnt use a then on one if but I did on the other two. I must have started reducing the code then decided it didnt need it.


Koriolis(Posted 2007) [#68]
Psychedelic soap bubbles:

247 bytes


CS_TBL(Posted 2007) [#69]
neat!


Pete Rigz(Posted 2007) [#70]
Thought I'd have a bash:

250 bytes


Koriolis(Posted 2007) [#71]
4th entry, probably the last one.

223 bytes.


Oddball(Posted 2007) [#72]
Wow! That's impressive Pete. I think it's the best so far.


computercoder(Posted 2007) [#73]
I thought I'd give this a try... Nothing special just a lil chase routine :)

use the arrows to move, ESC to quit

only got it to 365... :(

g=200;r=190;Graphics g,g;SetColor 150,100,250;s=5;x1=100;y1=160;While KeyHit(27)=0;Cls
If KeyDown(37) Then x:-s;If KeyDown(39) Then x:+s;If KeyDown(38) Then y:-s;If KeyDown(40) Then y:+s
If x<0 Then x=0;If x>g Then x=g;If y<0 Then y=0;If y>g Then y=r;DrawOval(x,y,10,10);If x<x1 Then x1:-2 Else x1:+2;If y<y1 Then y1:-2 Else y1:+2
DrawRect(x1,y1,10,15);Flip;Wend



-- EDIT --

I worked it a bit and got it down to 208! :)

g=99;Graphics g,g While KeyHit(27)=0;If KeyDown(37)x:-5
If KeyDown(39)x:+5
If KeyDown(38)y:-5
If KeyDown(40)y:+5
If x<a a:-2 Else a:+2
If y<b b:-2 Else b:+2
DrawOval x,y,7,7DrawRect a,b,9,9Flip;Cls;Wend


-- EDIT 2 --

Best *with* edge detection is 256

g=99;Graphics g,g While KeyHit(27)=0;If KeyDown(37)x:-5
If KeyDown(39)x:+5
If KeyDown(38)y:-5
If KeyDown(40)y:+5
If x<0 x=0
If x>g x=g
If y<0 y=0
If y>g y=g
If x<a a:-2 Else a:+2
If y<b b:-2 Else b:+2
DrawOval x,y,7,7DrawRect a,b,9,9Flip;Cls;Wend




impixi(Posted 2007) [#74]

there is one problem with EXE < 256kb (apart from being not a very challenging size)



Huh? Not very challenging? Many Blitz programmers can’t finish coding a game of any size. ;)


Brucey(Posted 2007) [#75]
computercoder,

You can swap out those If's for
x=Max(0,Min(x,g))
y=Max(0,Min(y,g))

which saves you some more bytes :-)


Pete Rigz(Posted 2007) [#76]
a variation on my previous one: Nucleus, 242 bytes

And also: Twin Nucleus:
which is 246


computercoder(Posted 2007) [#77]
Brucey, Thanks for the tip! Wouldn't have thought of that ;)

-- Edit --

That made it hit 246 bytes! AWESOME!


amonite(Posted 2007) [#78]
A very classic effect but i couldn't come with anything more
original, at least it is better than my first entry.
Graphics 640,480Repeat Cls;a:+1;SetColor 150,0,10*Sin(a)+50;SetBlend lightblend;SetLineWidth 5For i=1 To 60 DrawLine 500*Sin(i-(Cos(a)*50)),500*Sin(i-(Sin(a)*50)),500*Sin(i-(Sin(a)*50))+100,500*Cos(i-(Sin(a)*100))+100Next Flip 
Until KeyHit(27)

253 bytes

i really like koriolis' bubbles as well as the one by Pete Rigz


computercoder(Posted 2007) [#79]
Benyboy:

Nice effect!

Replace
Repeat Until KeyHit(27)

with
While KeyHit(27)=0 ;Wend
and condensing it to one line will shave some bytes (10 to be exact :) )

Here's my edits (I did some other edits too):
Graphics 640,480While KeyHit(27)=0;Cls;a:+1;SetColor 150,0,10*Sin(a)+50;SetBlend lightblend;SetLineWidth 5For i=1To 60DrawLine 500*Sin(i-(Cos(a)*50)),500*Sin(i-(Sin(a)*50)),500*Sin(i-(Sin(a)*50))+100,500*Cos(i-(Sin(a)*100))+100Next Flip;Wend

Total of 241 bytes :)


Paul "Taiphoz"(Posted 2007) [#80]
could I request that each of you post a readable one and the single line effort.

PS.. those are genius


computercoder(Posted 2007) [#81]
Sure thing... not that mine is even near the best :P

This one has the tip included that Brucey suggested :)

g=99

Graphics g,g 

While KeyHit(27)=0
	' Detect key pressed
	If KeyDown(37) x:-5
	If KeyDown(39) x:+5
	If KeyDown(38) y:-5
	If KeyDown(40) y:+5
	
	' Determine edge
	x=Max(0,Min(x,g))
	y=Max(0,Min(y,g))

	' Create chase direction
	If x<a a:-2 Else a:+2
	If y<b b:-2 Else b:+2

	' Draw User Circle
	DrawOval x,y,7,7
	
	' Draw Chase rectangle
	DrawRect a,b,9,9
	
	Flip
	
	Cls
Wend



Damien Sturdy(Posted 2007) [#82]
holy crap! Pete! Twin Nucleus' is awesome :)


Curtastic(Posted 2007) [#83]
My game is the coolest


Pete Rigz(Posted 2007) [#84]
holy crap! Pete! Twin Nucleus' is awesome :)

Thanks. I corrected the spelling now too! :)


amonite(Posted 2007) [#85]
@Curtastic, i can't score anything too :P
@computercoder thanks for your edit.

the web page i made to keep all the entries has been updated :
http://perso.orange.fr/amagumo/255BDC.html

so far there are 33 entries !!
(haha i just figured out how to display code in a html page using
<xmp></xmp>)


CS_TBL(Posted 2007) [#86]
Something tells me this challenge ain't over yet.. every time a few empty hours have past, another tidal wave worth o' entries pops up.. :P


Matthew Smith(Posted 2007) [#87]
Thats great stuff!


computercoder(Posted 2007) [#88]
I think you're right CS_TBL! This is one of those really fun tests of ability :)


CS_TBL(Posted 2007) [#89]
I'm a bit out of 255byte juice tho.. :) I've been spending the days on my texture generator (see "Uses for BlitzMmax" thread for examples -last post-). So I guess we'll have to wait for the annonuncement of a *real* deadline.. :P


computercoder(Posted 2007) [#90]
Aye mate! I've been concentrating on my 2D World Designer as well (also posted in "Uses for BlitzMax"). This deal was a fun lil break from the project tho :) (I only posted one demo here, but it was still fun!)


Amon(Posted 2007) [#91]
I've been watching this thread and I thought I'd pop in and say that there are some really great examples posted.

Gotta say that my fav is the twin Nucleus by pete. It's that cool.

:)


amonite(Posted 2007) [#92]
Another try :)
electric ball, 164 bytes
w=640 h=480Graphics w,h While KeyHit(27)=0; Cls; For a=1 To 360 Step 2SetColor Rand(255),0,Rand(255)DrawLine w/2,h/2,w/2+Cos(a)*100,h/2+Sin(a)*100Next Flip; Wend 

its variation:supraluminal speed, 190 bytes
w=640 h=480Graphics w,h While KeyHit(27)=0; Cls; For a=1 To 360 Step 2SetColor Rand(255),0,Rand(255)SetScale Rand(4),Rand(4)DrawLine w/2,h/2,w/2+Cos(a)*100,h/2+Sin(a)*100Next Flip; Wend 



altitudems(Posted 2007) [#93]
Benboy,

Great idea creating this offsite. Here is template you can use if you would like. Just paste it into a new html file.



Curtastic(Posted 2007) [#94]
My game. Click the circles. Can anyone beat 8?

I wasn't forcing the refresh rate before so now it goes at the right speed.
g=555Graphics g,g,0,60Repeat
r#:-1+l/4^5If MouseHit(1)&(Sqr((MouseX()-x)^2+(MouseY()-y)^2)<r)r=0;s:+1
If r<=0 x=Rnd(g)y=Rnd(g)s:-r<0r=29+Rnd(99)
DrawOval x-r,y-r,r*2,r*2DrawText s+":%"+l/10,0,0Flip
Cls
l:+1Until KeyHit(27)Or l>999Notify s+" :)"



Chris C(Posted 2007) [#95]
holy bytes! coder boy!

This is an amazing thread, I've been a bit busy for a few days and expected to come back to it with just one or two new entries

I've decided there should be an end date! 2007-03-18 23:59PM GMT

time permitting a few days later I will come up with a winner (somehow!!!) but its going to be a hard job picking just a single winner, I may end up picking several winners in different categories

So you have till the end of the weekend coming guys get cracking, here's a clue colour soap bubbles and Twin Nucleus are both very defiantly in with a very good chance.

I have to say the over all standard has really impressed me, and there are certainly no losers here.


Damien Sturdy(Posted 2007) [#96]
A New one: 250 exactly.

e#=128f#=512g#=360Graphics f,f;Repeat;For x#=-1To 1 Step .01For y#=-1To 1 Step .01o#=(x*Sin(a))+y*Cos(a)p#=(y*Sin(a))-x*Cos(a)q#=o*f;SetColor e+Sin(q)*f,Cos(q)*f,g-Cos(q)*f;Plot f/2+o*e+Sin(y*g)*20,f/2+p*e/2-Cos(x*g)*40Next;Next;a:+1Flip;Cls;Forever


and a modified old one @ 247:

Graphics 640,480b#=0d#=128Repeat;x#=320y#=240o=x;p=y;a#=-b*5For c#=1To 750 Step .2;e#=Sin(c+b*30)SetColor d+e*d,d+Cos(c+b*30)*d,d-e*d;DrawLine o,p,x,y;o=x;p=y;x=x+Sin(a)*c;y=y+Cos(a)*c;a=a+30+Sin(b);b=b+.002Next;b=b-7.45Flip;Cls;Until KeyDown(27)



Damien Sturdy(Posted 2007) [#97]
Damnit guys! Did I drop a smelly wet fart in here or something?


amonite(Posted 2007) [#98]
LOL
Your last 2 demos looks really astounding to me, that's some pretty cool effect you have here Cygnus !!

@Curtastic, my score is -5, and i won't try to beat it because it's too stressful for me :p

edit:
thanks altitudems, i used your template and updated the site:
http://perso.orange.fr/amagumo/255BDC.html


altitudems(Posted 2007) [#99]
Nice Cygnus!

Benboy,

I'm glad you were able to use it. Here is an updated version of your page with some JavaScript to toggle the code boxes.

http://www.sharebigfile.com/file/113537/255BC-zip.html


Damien Sturdy(Posted 2007) [#100]
Nice website and thanks Benyboy!

Though on your website, your "Cygnus Entry 2" isn't mine, its Koriolis'. I reduced it to 247 for him ;)

My four entries are:

Graphics 640,480Repeat;o=320;p=240For i#=0To 360f#=Sin(i)*128s=Sgn(Cos(i))For x#=0To 8Step .04b#=(x^2)-64a#=((8-x)^2)-64For e=a To -a;c#=Rnd((e/2)+f+(b*(b/400)))*6SetColor 64-c,c,c;Plot o+e*s,p+b;Plot o+e*s,p-b;Next;Next;Flip;Next;Until Keyhit(27)

Graphics 640,480b#=0d#=128Repeat;x#=320y#=240;o=x;p=y;a#=-b*5For c#=1To 750;e#=Sin(c+b*30)SetColor d+e*d,d+Cos(c+b*30)*d,d-e*d;DrawLine o,p,x,y;o=x;p=y;x=x+Sin(a)*c;y=y+Cos(a)*c;a=a+90+Sin(b);b=b+.01Next;b=b-7.4Flip;Cls;Until KeyDown(27)

Graphics 640,480b#=0d#=128Repeat;x#=320y#=240o=x;p=y;a#=-b*5For c#=1To 750 Step .2;e#=Sin(c+b*30)SetColor d+e*d,d+Cos(c+b*30)*d,d-e*d;DrawLine o,p,x,y;o=x;p=y;x=x+Sin(a)*c;y=y+Cos(a)*c;a=a+30+Sin(b);b=b+.002Next;b=b-7.45Flip;Cls;Until KeyDown(27)

e#=128f#=512g#=360Graphics f,f;Repeat;For x#=-1To 1 Step .01For y#=-1To 1 Step .01o#=(x*Sin(a))+y*Cos(a)p#=(y*Sin(a))-x*Cos(a)q#=o*f;SetColor e+Sin(q)*f,Cos(q)*f,g-Cos(q)*f;Plot f/2+o*e+Sin(y*g)*20,f/2+p*e/2-Cos(x*g)*40Next;Next;a:+1Flip;Cls;Forever




Damien Sturdy(Posted 2007) [#101]
OK I created a screensaver out of my spiral logo code:

http://damientsturdy.pwp.blueyonder.co.uk/spiralsaver.scr


Koriolis(Posted 2007) [#102]
And now ladies and gentlemen, the smallest web server in the world!

248 bytes.

Will turn your computer in a http server.
You'd better have a firewall on your computer BTW...
The server's root is the program's directory, so if you don't save the code to a file and run it right from the standard IDE (from an untitled docuemnt), the root will be .../BlitzMax/tmp. Not many usefull docs to see there.
So save the program in a source file right at the root of your BlitzMax folder for example.
Run the program and point your browser to "http://localhost/doc/index.html"
Tada, the BlitzMax help page!

Provided your firewall doesn't filter connexions on port 80, you can check that a buddy can also access it via http://<yourip>/doc/index.html
That's right, you're running a 248 bytes long http server :p


Koriolis(Posted 2007) [#103]
Well I think *I* dropped a smelly wet fart lol


Pete Rigz(Posted 2007) [#104]
My personal fav here is soap bubbles I think. Impressive webserver there Koriolis, it's amazing what you can do in such a short amount of code.

After reading through everyones examples and tips I'm just resubmitting my twin nucleus one after getting it down to 231 bytes. Enough room for an extra effect, although anything i tried squeezing in seemed to spoil it, less is more perhaps?




Koriolis(Posted 2007) [#105]
Twin nucleus is really great. With only 231 bytes I'm sure you could add some interesting color effect.


amonite(Posted 2007) [#106]
@Koriolis, amazing small http server !
@Pete Rigz, i added your optimization to the offsite :

http://perso.orange.fr/amagumo/255BDC.html

now you can browse through all the entries in a nice way thanks to altitudems and his nice css presentation :)
(let me know if i made any mistake!)


Damien Sturdy(Posted 2007) [#107]
So, Who wins Chris?


QuietBloke(Posted 2007) [#108]
Just popped in to see who had won and found a bunch more to try out tonight.

A webserver !? lol.. thats just crazy.

I wouldnt want the job of picking a winner.. there are some amazing entries.

Its a pity the forums dont have a voting system.


Koriolis(Posted 2007) [#109]
Err, wasup doc?


CS_TBL(Posted 2007) [#110]
Whoever wins should initiate a 512bytes challenge.. :P


altitudems(Posted 2007) [#111]
Yes, agreed, that should be amazing! Just imagine what people could with 512bytes!


Damien Sturdy(Posted 2007) [#112]
Well, Chris went missing about 4 days back :P get your entries in now whilst you can! Haha.


Koriolis(Posted 2007) [#113]
I wrote some crappy piece of code to automatically execute all the entries in this thread, save their code to disk and take a screenshot after 10 seconds of execution.

The code & screenshots are saved to the "_bbchallenge_" sub-directory.
For the screenshot functionality, it uses the DesktopExt module (windows only) available here : http://www.chaos-interactive.de/index.php?show=12&lang=eng.


Damien Sturdy(Posted 2007) [#114]
Koriolis....

I needed that module...perhaps 8 months ago....!!!!


FischGurke(Posted 2007) [#115]
Amazing programs so far...
Here's my attempt... 255 bytes in size. :)
g=300;Graphics g,g,0;Local a[g*g];Repeat;a[Rand(g)]=1;For x=g To g*g
If(x+2)Mod g=0 Then x:+3
f=Rand(-3,2);If a[x]~a[x-g+f]
a[x-g+f]=0;a[x]=1;c=255;SetColor c,c,c;Plot x Mod g,x/g;SetColor 0,0,0;Plot x Mod g+f,x/g-1;End If;Next;Flip 0;Until KeyDown(27)

You can change the size of the graphics window with the variable g. Any optimisations are welcome! :)
Here's the "clean", commented code:
g=300
Graphics g,g,0 'square graphics window
Local a[g*g] 'initialise an array to hold the "snowflakes"
Repeat
	a[Rand(g)]=1 'spawn a snow flake
	For x=g To g*g 'update all snow flakes
		If(x+2)Mod g=0 Then x:+3  'skip some pixels if we're close to the edge to avoid "stuck" flakes
		f=Rand(-3,2)  'move flakes to the left or right randomly
		If a[x]~a[x-g+f]  'if the pixel the flake tries to move to is unoccupied
			a[x-g+f]=0    'move flake by swapping values
			a[x]=1
			c=255   
			SetColor c,c,c  'set color to white
			Plot x Mod g,x/g  'draw flake
			SetColor 0,0,0  
			Plot x Mod g+f,x/g-1  'remove trail
		End If
	Next
	Flip 0  'woo :)
Until KeyDown(27) 'repeat until escape is pressed



amonite(Posted 2007) [#116]
@Koriolis,
very handy piece of code, i just had to rename your variable
"BMK_PATH" to "PATH" to make it run on Win2K .

@FishGurke, weird ! (i like the accumulation effect)

(i wonder where is Chris)


FischGurke(Posted 2007) [#117]
Here's a smaller (222 Byte) version with smoother animation but (increasingly) slower drawing:
g=300;Graphics g,g,0;Local a[g*g];Repeat;a[Rand(g)]=1;For x=g*g To g Step -1;If(x-2)Mod g=0 Then x:-3;f=Rand(-1,1)
If a[x]~a[x-g+f]
a[x-g+f]=0;a[x]=1;End If;If a[x]Then Plot x Mod g,x/g
Next;Flip 0;Cls;Until KeyDown(27)

It's supposed to be some kind of "snow storm" effect, thus the accumulation. (glad you like it.)
edit: Finally, here's a smooth, small version (albeit a bit slower because the pixels can warp from side to side). :) (243 Bytes)
g=200;h=g*g;Graphics g,g;Local a[h],b[h];Repeat;a[Rand(g)]=1;For x=h To g Step -1;f=Rand(-1,2)
If a[x]~a[x-g+f]
a[x-g+f]=0;a[x]=1;End If
If a[x]~b[x]
c=255*a[x];SetColor c,c,c;Plot x Mod g,x/g;b[x]=a[x];End If;Next;Flip 0;Until KeyDown(27)



sswift(Posted 2007) [#118]
253 bytes:

Graphics 800,600,32I:TPixmap=CreatePixmap(800,600,5)For Y=0To 599For X=0To 799P#=0Q#=0N=0While(P*P+Q*Q<4)&(N<50)R#=P*P-Q*Q-2+X*.0035S#=2*P*Q-1.2+Y*.004P=R Q=S N:+1Wend I.WritePixel X,Y,N*2^19*(N<50)Next Next Repeat DrawPixmap I,0,0Flip 1Until KeyHit(27)


I thought I'd be able to do a lot more with it, but it turned out to be a real challenge squeezing this into that amount of space!

I could probably get it smaller if I changed it to use setcolor and plot instead of createpixmap, writepixel, and drawpixmap, but that probably wouldn't give me enough leeway to do any sort of animation with it. I was hoping when I started that I could make it do a realtime zoom.


Czar Flavius(Posted 2007) [#119]
Epilepsy warning! Do not view.

Graphics 640, 480, 1
While Not KeyDown(1)
	SetColor 255, 255, 255
	DrawRect 0, 0, 640, 480
	Flip
	SetColor 0, 0, 0
	DrawRect 0, 0, 640, 480
	Flip
Wend



altitudems(Posted 2007) [#120]
@sswift Nice Fractals!

@Czar, that is great! Instant headache! Ouch! Lol
I could not even escape for a brief time because with BMAX the escape key is mapped to 27 not 1. Why do I feel the need to disregard warnings like "Do not view".


altitudems(Posted 2007) [#121]
Ok here is a late entry. Pong w/out player control(ran out of bytes)
Can anyone figure ou† how to compress this more?

Edit:
Now playable w/ mouse
256bytes



CS_TBL(Posted 2007) [#122]
hm, dunno, perhaps make the ball square (DrawRect) and make a one-char function pointer for DrawRect? :D


altitudems(Posted 2007) [#123]
CS_TBL
Thanks for the suggestion, but I don't use drawrect enough to make it worth while. I figured out how to squeeze in mouse support though.


FischGurke(Posted 2007) [#124]
@sswift: Awesome fractal!
@altitudems: Pretty cool, can you add a scoring system? :)
Here's another little something I made (231 Bytes):
g=256Graphics g,g;AutoMidHandle(1)r=10i=CreateImage(g,g)h=g/2SetBlend 3SetRotation 2SetScale 1.1,1.1c=247SetColor c,c,c;Repeat;GrabImage(i,0,0)DrawImage i,h,h;For n=0 To 20Plot Rand(-r,r)+h,Rand(-r,r)+h;Next;Flip 0Until KeyDown(27)
:)


CS_TBL(Posted 2007) [#125]
*bump*

any winner yet?


Sledge(Posted 2007) [#126]
Hee hee - only just saw this. I started by doing a typed starfield and didn't have much room for anything else. Then I spotted QuietBloke's starfield and thought that resetting the random seed and regenerating the values each frame was a really cool space-saving idea, so my effort is really an extension of that approach.

Mini Intro
Multi-plane, multi-color starfield & sine text. (250 bytes)




CS_TBL(Posted 2007) [#127]
*bump*

so, any winner yet? :P


Koriolis(Posted 2007) [#128]
Right, we can't seriously let this challenge die without a proper fading out...


Pete Rigz(Posted 2007) [#129]
I declare everyone a winner :)


Xerra(Posted 2007) [#130]
Threads like this are fascinating. I'm so old I can remember poking instructions into a Vic 20's 6502 processor trying to squeeze every byte out of a 3.5k machine.

Developers nowdays just don't have the kind of memory problems we had in those days trying to do something cool with so little memory. Of course games on the Vic 20 didn't take 2 years to develop though, either :)


CS_TBL(Posted 2007) [#131]



amonite(Posted 2007) [#132]
duke4e (who for some reason cannot post and would like to participate) asked me if i could add is entry to the thread so here it is :
HideMouse
s=600a=1b=1c=s/2d=s/7Graphics s,s
While 1Cls;x=MouseX()DrawRect x-40,s-9,80,9DrawRect x-40,0,80,9DrawOval c-9,d-9,18,18DrawText w,3,3
c:+a*7;d:+b*7;If d>s Or d<0End
If Abs(c-x)<40If d>s-10Or d<10b:*-1;w:+1
If c>s Or c<0a:*-1
Flip;Wend

Its Pong in 252 bytes !


remz(Posted 2007) [#133]
I just found this thread, so I decided to give it a try, it's so cool. There's some really creative Blitzmax' out there! Keep them coming!

My attempt [254 bytes]
Blitzmax Spiral
Graphics 512,512 b#=90 y#=360 c#=0 u#=99 z#=255 t$="Blitzmax"
While 1 Cls
For i=0Until 400 j=i*2 a#=b+i*y/8s#=Sin(u)*3+3.5
SetTransform a, s, s SetOrigin z+j*s*Cos(a),z+j*s*Sin(a)
DrawText Chr(t$[i&7]),0,0Next b:+.5*Sin(c) c:+.3 y:+.1 u:+.14Flip;Wend



ImaginaryHuman(Posted 2007) [#134]
Hey this stuff is cool.

I tried to implement realtime blobby objects in 256 bytes but alas I could not do it - this is considerably over, at 397 bytes

But it works - and it's interactive ;-D

It could've been smaller using SetColor and Plot, eliminating the pixmap, and then doing GrabImage, but strangely this resulted in a blank image - something to do with multiple backbuffer frames I think - ie the issue which needs a pixmap to be grabbed to fix the frame lag. If that worked I might shave off 50-100 bytes, but anyway.

Also even though I specify PF_RGBA8888 for the pixmap format, it gives me an ABGR format. Duh! So if the default format on your machine is not ABGR this will not look right.


remz(Posted 2007) [#135]
Nice! That's an ultra-short version your previous 'blob' code right?

I have to admit something: although this kind of challenge is extremely fun and.. challenging.., there is a little quirk with having a code size limit. This only serves one purpose: obfuscate the code, variable with only 1 letter, no white space, etc. Even if the limit would be 4KB or more, compact code would allow more stuff than clean code. This is not good practice and not friendly for sharing tricks and algorithms.

A better challenge would be to do something with an .EXE size limit: then again, we may need to specify a framework and a short list of available modules or else size wouldn't be comparable. But this might restrict creativity ..! Argh :)


ImaginaryHuman(Posted 2007) [#136]
I just spend a bit of time refining it, down to below 400 bytes now.

It's the same principle yes - precalculate energy levels with a curved falloff and store the values in an image, then render the image with additive blending.

I agree with you, though, I would not normally use single letter variables, I am usually verbose. But it was a fun challenge.


amonite(Posted 2007) [#137]
He Remz your spriral thing is really cool !
ImaginaryHuman, who could have thought you could place your blobs here, that's very well done even if you can't make it to the size requested by the rules :)
(BTW, if you read this Chris, just wanted to let you know that if i don't spend anymore time on the chat it's because of severe RSI i'm suffering from nowdays...)


Curtastic(Posted 2007) [#138]
A graphical one from me. 248 bytes.
MouseX controls the green color.

p=512Graphics p,p
p:/2e#=-.0007While 1If Int(m#)&p a=Rnd(1,7)d=Rnd(6)e=-e
m:+e
n#:+.1r:+a
b:+d
If r&p a=-a;r:+a
If b&p d=-d;b:+d
If n>=360n:-360Flip 0If KeyHit(27)End
SetColor r,MouseX()/2,b
DrawRect p+Cos(n)*m-33,p+Sin(n)*m-33,63,63
Wend



Damien Sturdy(Posted 2007) [#139]
Lol, I do agree with that, Remz, but it seems you've never programmed on a computer with 1K of ram ;-)

The buzz for me is that we HAD to do this kind of stuff to get all the juice out of a machine back in the day. :-)


remz(Posted 2007) [#140]
Curtastic that's really good! And you even managed to fit a keyhit(27)! How user friendly ;)

Lol, I do agree with that, Remz, but it seems you've never programmed on a computer with 1K of ram ;-)

Oh yes I did my share of that, don't worry ;)
But unless you are on a interpreted language, variable names and whitespace doesn't count in final exe size, that's what I meant.

Maybe we could just start a new challenge with 512 bytes of code, that would give us just the little bit of spare to do amazing things. Ok I get it: since I said that, I'll start the thread!


Koriolis(Posted 2007) [#141]
If I can suggest something, I think it would be good idea to use the number of tokens, not the number of characters. First write some little BlitzMax app to count the tokens in a given source file, and use that as the reference for the contest.


Curtastic(Posted 2007) [#142]

Curtastic that's really good! And you even managed to fit a keyhit(27)! How user friendly ;)


Thanks I updated it so that MouseX controls the green color.


Koriolis(Posted 2008) [#143]
You know you're bored when you revive a dead thread, and even have a new entry...
c=9999;d=c*5;e=22000;f=999Local p:Byte[c]For i=0 To c-1;p[i]=Sin(i)*255Next;While 1z="chccdeababacdedefgfcdeabacacdedefgfgefgfgcfg"[j]-97LoadSound(CreateStaticAudioSample(p,[1,f,f,c,c,f,c,f][z],[c,e,c,e,c,d,d,e/3][z],1)).Play;j=(j+1)Mod 44Delay 225Wend
I call this one "party", turn up the sound to see why. 252 bytes.
I know, I'm not an artist ;D


plash(Posted 2008) [#144]
haha nice

edit: more bass!
c=9999;d=c*5;e=22000;f=999Local p:Byte[c]For i=0 To c-1;p[i]=Sin(i)*96Next;While 1z="chccdeababacdedefgfcdeabacacdedefgfgefgfgcfg"[j]-97LoadSound(CreateStaticAudioSample(p,[1,f,f,c,c,f,c,f][z],[c,e,c,e,c,d,d,e/3][z],3)).Play;j=(j+1)Mod 44Delay 225Wend



degac(Posted 2008) [#145]
With [b]SetAudioDriver("DirectSound")[b] I get

CreateSoundBuffer failed (87)


with other drivers it works...

Nice!