Author Topic: PurePunch Contest #2 - FlipFrac  (Read 4519 times)

0 Members and 1 Guest are viewing this topic.

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
PurePunch Contest #2 - FlipFrac
« on: June 16, 2009 »
This is just my small and fast contribution for a contest on the purebasic community...


Windows Version (Exit by pressing ESCAPE):
Code: [Select]
;*****************************************************************************
;*
;* 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):
Code: [Select]
;*****************************************************************************
;*
;* 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
« Last Edit: June 23, 2009 by va!n »
- 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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: FlipFrac
« Reply #1 on: June 16, 2009 »
It runs pretty quick for obfurscated code.
Nice one va!n :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: FlipFrac
« Reply #2 on: June 16, 2009 »
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:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: FlipFrac
« Reply #3 on: June 17, 2009 »
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: FlipFrac
« Reply #4 on: June 18, 2009 »
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:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: FlipFrac
« Reply #5 on: June 18, 2009 »
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: