• Welcome to Dark Bit Factory & Gravity.
 

PurePunch Contest #2 - FlipFrac

Started by va!n, June 16, 2009

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

va!n

This is just my small and fast contribution for a contest on the purebasic community...


Windows Version (Exit by pressing ESCAPE):

;*****************************************************************************
;*
;* Name   : FlipFrac - flipping flat fractal with faked lightsourcing effect                              
;* Author : Thorsten Will - aka 'Mr.Vain of Secretly!'
;* Date   : 16.06.2009                                    
;* Notes  : Entry for the PurePunch Contest #2
;*          The rule is to code something in max 10 lines of 80 characters!
;*          I did a small graphic effect in just only 5 lines of code! ;-)
;*          Win32 API has been used to check if user pressed the ESCAPE key
;*
;*****************************************************************************  
InitSprite():OpenScreen(640,480,32,""):b=255:Repeat:StartDrawing(ScreenOutput())
For m=0 To 639:For n=0 To 479:c=(64+Random(128))<<16:p.f=(m-320)/(Sin(t.f)*200)
q.f=(n-240)/(Cos(t)*200):x.f=0:y.f=0:For i=0 To 31:u.d=x*x-y*y+p:v.d=2*x*y+q
If(u*u+v*v)>4:Goto E:EndIf:x=u:y=v:Next:c=Cos(t)*200:c=RGB(c,c,b):E:Plot(m,n,c)
Next:Next:StopDrawing():t+0.05:FlipBuffers():Until GetAsyncKeyState_(27):End



Cross Platform Version (automatical exit after some seconds, just change Until t>10] value):

;*****************************************************************************
;*
;* Name   : FlipFrac - flipping flat fractal with faked lightsourcing effect                              
;* Author : Thorsten Will - aka 'Mr.Vain of Secretly!'
;* Date   : 16.06.2009                                    
;* Notes  : Entry for the PurePunch Contest #2
;*          The rule is to code something in max 10 lines of 80 characters!
;*          I did a small graphic effect in just only 5 lines of code! ;-)
;*          Exit automatical after some seconds to fit still into 5 lines of code
;*
;*****************************************************************************  
InitSprite():OpenScreen(640,480,32,""):b=255:Repeat:StartDrawing(ScreenOutput())
For m=0 To 639:For n=0 To 479:c=(64+Random(128))<<16:p.f=(m-320)/(Sin(t.f)*200)
q.f=(n-240)/(Cos(t)*200):x.f=0:y.f=0:For i=0 To 31:u.d=x*x-y*y+p:v.d=2*x*y+q
If(u*u+v*v)>4:Goto E:EndIf:x=u:y=v:Next:c=Cos(t)*200:c=RGB(c,c,b):E:Plot(m,n,c)
Next:Next:StopDrawing():t+0.05:FlipBuffers():Until t>10:End



Attached compiled Win32 version
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Shockwave

It runs pretty quick for obfurscated code.
Nice one va!n :)
Shockwave ^ Codigos
Challenge Trophies Won:

ferris

Heh better than I expected from that small segment :D
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

benny!

N1, good luck with this in the competition!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Clyde

Yeah, hope you do well dude.
Is your group called Secretly, Mr Vain ?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

va!n

thx for feedback...

@Clyde:
yes... me is called "mr.vain of secretly!" (groupname with exclamation mark ^^)
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won: