PurePunch Contest #3

Share your advanced PureBasic knowledge/code with the community.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

PurePunch Contest #3

Post by djes »

September 2009

The contest is over.

Here's the PurePunchs archive.

Seeing the limited entries, I've decided to stay the vote and to declare winners all the competitors.

Thank you and congratulations to :

MrVain, Demo category
Papip et Dobro, Utilities category
Huitbit, Games category


However, I hope the next contest to be more successful. Summer, and maybe rules complexity are maybe why this one hadn't attracted more of our talented coders.



----------------------------------------------



July 2009

Here it is the PurePunch Contest #3!

I received and took care of several remarks to enhance the idea.

Several categories are seing light (one winner per category):
  • 1° Application/Utility/System
    2° Game
    3° Demo
    4° PurePunch Cruncher : the idea is to take a previous contest PurePunch and enhance it, or reduce its size :)
    5° Beginner
The rules :
  • 1° The program will be created using Purebasic 4.31 without userlib.
    2° The program source will only have 20 lines of 80 characters max per line or max 50 lines, with only one instruction per line, correctly indented (comments accepted). This last option should be privilegied for smallest codes.
    3° To be unique, either a complete creation, or bringing something new to an existing code.
    Must not to be harmful
    5° Possibility to add a graphic file (only one image, or sprite, or texture...), maximum size 512 pixels width by 512 pixels height, 32 bits. Post it on the forum or on another site which must be reachable during the contest length, or included in a full project archive posted in the forum.
    6° Possibility to add a sound file (and only one) maximum size 1Mb. Post it on another site which must be reachable during the contest length, or included in a full project archive posted in the forum.
    7° It will be possible to add a line (not accounted), at the beginning of the source, to alert the user of a program specificity (for example, a delay or a particular subsystem). This line must be like

    Code: Select all

    MessageRequester("Information","txt",#PB_MessageRequester_Ok)
    Two months delay to create the best PurePunch!
At the end of this period (September, the 1st), a poll will be created to vote for the best code. Do your best and it'll be yours!

Post the code on this forum, after adding and completing the following header:

Code: Select all

;*****************************************************************************
;*
;* PurePunch Contest #3
;*
;* Name     :  
;* Author   : 
;* Category :
;* Date     : 
;* Notes    :
;*
;*****************************************************************************
Good luck to all competitors! :)

Edit: 20 lines, 1Mb soundfile, 2 months delay
Edit2: added beginners category
Edits: Typo/grammar
Last edited by djes on Wed Sep 02, 2009 8:46 pm, edited 8 times in total.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

As forumers asked, I've changed the rules. You have now 20 lines and two months to win the PurePunch contest #3. Have a nice code :)
User avatar
pcfreak
User
User
Posts: 75
Joined: Sat May 22, 2004 1:38 am

Post by pcfreak »

was there a 'winner' in the last contest? and how do you want to decide the winner in this contest?
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

@PCFreak

You can choose him!

>> Vote Contest #2

Ollivier
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I've added a beginners category
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

@djes, you forgot to add:
- females are also invited to code and competite.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Psychophanta wrote:@djes, you forgot to add:
- females are also invited to code and competite.
Why should I specify that? Had I kind of machismo vocabulary? I'm (trying to) don't make differences between males and females when it comes to anything different than reproduction.

Anyway! If you don't have ideas, I found that on /. -> http://www.programmerfish.com/source-co ... -released/ :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

djes wrote:I'm (trying to) don't make differences between males and females when it comes to anything different than reproduction.
hehe, i advise you to not try that, because there are :?
But no big differences anyway.
djes wrote:Anyway! If you don't have ideas, I found that on /. -> http://www.programmerfish.com/source-co ... -released/ :)
Thanks but don't like copied ideas, i'd prefer more authentic ones, :wink:
Just looking for time, as always, more than for inspiration for new individual ideas! :idea:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

> 20 lines of 80 characters max

I find this kind of limitation a bad idea, as it disqualifies any proper readable code... Can't we simply throw this overboard and replace it with 'n' lines each with a single statement? (No ':' colons!), and not count any comments?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Code obfuscation is part of the challenge :)
But there will be other rules in the future. By now, you can contest with the 50 "clean" lines limit.
Huitbit
User
User
Posts: 12
Joined: Thu Jun 11, 2009 4:56 am
Location: GUADELOUPE(F.W.I)

Let's go !

Post by Huitbit »

Hi,
A skill game (with the keyboard)
You play as |þˉþþU alias "Old skull"
an alien from the planet 8-bit, You've got to slow down the melting of the icebergs caused by the fall of strange meteors coming from the space (unfortunately, you can't do nothing against the global warming effect :cry: )

No sound, no picture only 20 lines
(S for score)
(H for highscore)

Enjoy :D !

Code: Select all

;***************************************************************************** 
;* 
;* PurePunch Contest #3 
;* 
;* Name     : "Old skull" game
;* Author   : Huitbit
;* Category : Game
;* Date     : 12 / 07 / 09
;* Notes    : "Purepunched" with the help of  the french coder Ollivier
;* 
;***************************************************************************** 
Macro D:Macro:EndMacro:D K:End:End#D:Dim C(4):Dim N(4):Dim O(4):InitSprite() 
D Q:EndIf:K#D:D R:Random:K#D:D F:DisplaySprite:K#D:L=640:H=480:Dim B(4):a=1 
D P:Next:K#D:D S(A,B,C):For A=B To C:K#D:InitKeyboard():D U:StopDrawing():K#D
S(I,1,4):D T(A,B,C):CreateSprite(A,B,C):StartDrawing(SpriteOutput(A)):K#D:P
OpenWindowedScreen(OpenWindow(0,0,0,L,H,"Old skull !"),0,0,L,H,0,0,0):T(0,L,99)
Box(0,0,L,99,$EFCF10):U:T(1,16,16):S(J,1,8):S(I,1,8)
If Mid(RSet(Bin(Asc(Mid("|þˉþþU",J,1))),8,"0"),I,1)="1"
Box(i*2-2,j*2-2,2,2,$FF):Q:P:P:U:T(2,16,16):Circle(8,8,8,$227CE9):U
T(3,48,H):Ellipse(24,0,24,360,$FCFBEB):U:G::s=0:x=4:y=0:w=0:C(0)=240:N(0)=R(L)
O(0)=-R(L):S(I,1,4):B(i)=B(i-1)+128+R(32):C(i)=160+R(160):N(i)=R(L):O(i)=-R(L)
P:Repeat:FlipBuffers():ClearScreen(0):S(I,0,4):If O(i)>440:N(i)=r(L):O(i)=-r(L)
C(i)+10:Q:If SpriteCollision(1,x,y,2,N(i),O(i)):N(i)=R(624):O(i)=-r(L):S+1:Q 
F(2,N(i),O(i)):O(i)=O(i)+1:P:S(I,0,4):F(3,B(i),C(i)):P:F(1,x,y):F(0,0,440)
S(I,0,4):If SpriteCollision(1,x+v,y+w,3,B(i),C(i)):If y<=C(i)-15:Z=C(i)-16:Q
I=4:Else:Z=0:Q:P:If SpriteCollision(1,x,y,0,0,440):If s>m:m=s:Q
MessageRequester("","S:"+Str(s)+Chr(13)+"H:"+Str(m)):Goto G:Q:ExamineKeyboard()
If KeyboardPushed(200):If z:w=-24:a=1:Q:Q:If KeyboardPushed(203) And x>3:v=-3
ElseIf KeyboardPushed(205) And x<621:v=3:Else:v=0:Q:If z=0:If y<=424:x+v:w+a
y+w:Q:Else:x+v:y=z:Q:Delay(1):Until WindowEvent()=16
Hasta la vista !

[EDIT] A new Oldskull's adventure on the french forum : Escape from Hell
http://www.purebasic.fr/french/viewtopi ... 465#101465
[EDIT]
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

*push*

has someone something still in work for the pure punch contest 3 ? i am still looking forward and hope that their will be again a lot of great enties.. ;)

best regards
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Okay, here we go... This is my contribution for PurePunch #3 ...
Hope some more entries from you guys here will follow next hours... ;) Good luck to all contributors... Greetz to everyone who knows me ^^

Image
.: Please download the full archive to get all needed media files / compiled version!
>> Download Here<<

Code: Select all


;*****************************************************************************
;*         _____          ______            __
;*        /\  _ `\      /'___\_ \          /\ \____
;*        \ \ \L\ \   __\ \__//\ \    __ __\_\ ,_\_\  ___   ___   ________  _
;*         \ \ ,  /_/'__`\ ,__\ \ \ /'__`\'___\ \/\ \/ __`\' _ `\/',_____ _ 
;*         _\_\ \__ \  __/\ \_/\_\ \_  __/ \__/\ \_\ \ \L\ \ \/\ \__, `\  
;*  _  ___/\_____\ \_\____\\_\ /\____\____\____\\__\\_\____/\_\ \_\____/\
;*  " __ __/_____/\/_/____//_/ \/____/____/____//__//_/___/\/_/\/_/___/\ 
;*      
;*    C A T E G O R Y :    P u r e P u n c h   C o d i n g C o n t e s t   3
;*
;*                  v e r s i o n   1.0  [ 31 - aug - 2009 ]
;*
;* ---------------------------------------------------------------------------
;*
;* PurePunch Contest #3
;*
;* Name.....: Reflections
;* Author...: Thorsten Will aka "Mr.Vain of Secretly!" (va!n)
;* Category.: Demo
;* Date.....: 31.08.2009
;*
;* Notes....: This is my contribution for the PurePunch coding cotest #3...
;*            The rule is to code something in max 20 lines, each max 80 chars!
;*            Its allowed to add a graphic file (only one image, or sprite, or
;*            texture...), maximum size 512x512 pixels using 32 bits! For music
;*            its allowed to add a soundfile (and only one) max filesize 1 MB!
;*
;* About....: I come up with a small demo that should run in same speed on any
;*            PC (fps independent) and should compile/run on windows,linux,mac!
;*            3D GfxCard must support any texturesize (else possible gfx probs)
;*            Please dont use OpenGL as SubSystem, it will make some problems!
;*       
;*            - Should compile and run on 32/64 bit Windows, Linux, Mac
;*            - Should run in same speed on any PC (fps independent)
;*            - Title and credits screen
;*            - Layers (skyline, floor, bobs) moving with the perspective
;*            - Moving oldskool copperbars
;*            - Moving realtime floor with faked reflection effect
;*            - Moving glowing blobs with small mirrow effect on the floor
;*            - Great atmospheric tune (sadly no loop, due fact of module lib)
;*            - Police car with animated blue/red lights
;*            - Heavy size optimized and crypted sourcecode (had a lot fun)
;*            - Source fits in only 19,5 lines (but can be done in 18,5 lines)
;*            - Exit by hitting the ESCAPE key...
;*            - What do you want more? Hope you like it... ;)
;*
;*
;*            P L E A S E   D I S A B L E   T H E   D E B U G G E R  !!! 
;*
;***************************************************************************** 

MessageRequester("Reflections v1.0 - 31-Aug-2009","Entry (20 liner) for PurePunch #3 - by va!n aka Thorsten Will",0)

Macro m(t,d):Macro t:d:EndMacr:EndMacro:m(Z,Sprite3DBlendingMode)o:m(D,Drawing)o
m(N,Sprite)o:n=b:m(W,Sprite3D)o:InitSound():a=800:h=600:InitKeyboard():b=400:o.f
Init#N():Init#W():m=b:OpenScreen(a,h,32,""):a=200:Sprite3DQuality(1):f=100:g=a;;
Load#N(0,"x.bmp",4):Display#N(0,0,0):Dim d(a):Start#D(ScreenOutput()):m(P,Next)o
For i=0 To 89:d(i)=Point(256+i,480):P:Stop#D():m(E,Display#W)o:For x=0 To 14;;;;
Grab#N(x,d(s),d(s+1),d(s+2),d(s+3),4):i=40<<16:TransparentSpriteColor(x,i):w=255
Create#W(x,x):Zoom#W(x,d(s+4),d(s+5)):s+6:P:_.f=0.01745:LoadModule(0,"x.mod");;;
PlayModule(0):m(U,FlipBuffers)o:i=2:j=6:Gosub L:Repeat:ExamineKeyboard():n=511;;
Start#D(SpriteOutput(0)):ot=nt:j=w*Sin(i*_):nt=ElapsedMilliseconds():dt=nt-ot;;;
tt.f=tt+dt*(1/15):i=tt:For y=0 To w:z.f=-a/y:v=n*z-i:o=-w*z+j:For x=0 To 511;;;;
t=(Int(o)!v)&64:o+z:c=Int((t/256)*y)+2:Plot(x,y,RGB(c,c,c<<1)):P:P:Stop#D():b=30
Create#W(0,0):Start3D():n=300:Zoom#W(0,800,n):E(0,0,n):E(14,0,0,b):E(3,-f+j/8,0)
d.f=e.f:For t=0 To 9:s=Sin(d)*64:d+0.27:E(7,0,f+s,w-t*26):P:E(13,-f+j>>2,n,74);;
e=-i/32:E(12,700,10,90):E(1,-f+j>>2,0):E(14,0,0,56):For n=0 To 45:g=240:q=i+n<<3
o=Cos(q*_):z=Sin(q*_):k.f=m+a*o:l.f=a+a*z/2:u.f=n*8-f*o/1.5:t=(n<<1+8)/2:d=g-f*z
c=j/6+a:Z(3,7):x=c-t:y=u-t:t<<1:Zoom#W(9,t,t):Zoom#W(10,t,t):E(9,k+x,l+y):x=125;
E(10,k+x,658-l+y):E(9,u+x,d+y):E(10,u+x,658-d+y):Z(5,6):P:E(5,20,330,245):Z(3,7)
t=8:If r<8:t=9:x=65:EndIf:Zoom#W(t,128,128):E(t,x,315):r=i%16:Z(5,6):Stop3D();;;
U():Until KeyboardPushed(1):i=4:j=11:Gosub L:End:L:Start3D():E(11,0,0):E(i,0,f);
Z(3,7):E(j,0,300):Z(4,5):Stop3D():U():Delay(6000):Return

va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Hey, MrVain! Nice entry, now it looks really professional! :) I do love the details, especially the police car lights :D
Hope there's some more entries before the end... Or I'll be forced to stop the contest during holidays...

Anyway, there's some hours left :)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I've updated the first post.
Post Reply