PurePunch Contest #5

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 #5

Post by djes »

October 2009

Here it is the PurePunch Contest #5!
The contest on the french forum

Categories (one winner per category):
  • 1° Application/Utility/System
    2° Game
    3° Demo
    4° PurePunch Cruncher : the idea is to enhance a previous contest PurePunch, or to reduce its size :)
    5° Max 5 lines
    6° Beginner
The rules :
  • 1° The program will be created using Purebasic without userlib.
    2° The program source will not have size limit for categories 1, 2, 3, 4, 6. For category 5, program source will only have 5 lines of 80 characters max per line
    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° Possibility to add an ASCII or Unicode datafile (and only one) maximum size 64Kb. This file can't contain source code. Post it on another site which must be reachable during the contest length, or included in a full project archive posted in the forum.
    8° 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)
    One month delay to create the best PurePunch!
At the end of this period (November, 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 #5
;*
;* Name     :  
;* Author   : 
;* Category :
;* Date     : 
;* Purebasic Version :
;* Notes    :
;*
;*****************************************************************************
Good luck to all competitors! :)

Edit : typo and datafile rule :)
Last edited by djes on Tue Nov 03, 2009 12:18 pm, edited 7 times in total.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 676
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PurePunch Contest #5

Post by Kurzer »

djes wrote: 2° The program source will not have size limit for categories 1, 2, 3, 4, 6. For category 6, program source will only have 5 lines of 80 characters max per line
I suppose you meant category 5. :wink:
PB 6.12 x64, OS: Win 11 24H2 x64, Desktopscaling: 150%, CPU: I7 12700 H, RAM: 32 GB, GPU: Intel(R) Iris(R) Xe Graphics | NVIDIA GeForce RTX 3070, User age in 2025: 57y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: PurePunch Contest #5

Post by Vera »

Dear djes,

thanks for keeping up these contests :)

but reading the new rules I got shocked reading 'Beginners = category 6 are only allowed 5 lines' - :shock: - but thinking it over it might not be meant as easing help but just be a typo :lol:

I'd like to request a further summable external data-file: something like a simple text-file holding a number of different strings (like a single image or sprite which may also contain several pictures in it).

As an example I'm thinking about a 'Fortune Coockie' where the result of the program could show up one of those 'happy strings' repealed in that text-file.

Could this be an interesting expansion to the contest ?

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

Re: PurePunch Contest #5

Post by djes »

Damn! Thank you for the typo error!

Vera> Ok for a datafile!
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: PurePunch Contest #5

Post by Olliv »

2O lines in order to fly in the space...(4.40 Beta 1)
x rotation = [Up] / [Down]
y rotation = [Left] / [Right]
z rotation = [Tab] / [A] (for AZERTY) ([Q] for QWERTY)
Speed = [Return]
Breaking = [Backspace]

Code: Select all

Macro M:Macro:EndMacro:M O:End:End#M:DisableDebugger:PA.F=0.008:TA.F=PA:B.F:J.F
M T:Drawing:O#M:M K():Keyboard:O#M:M W(S):Desktop#S:O#M:M U:For I=0 To:O#M:RA.F
J=0.9:M Ro(D,B,C):Procedure R#D(i,g.F):Protected.F X,Y,Z:X=X(i):Y=Y(i):Z=Z(i)
R=Sqr((B*B)+(C*C)):A=ACos(C/R):H=D:If B<0.:A=-A:Q:D#(i)=H:B#(i)=Sin(A+g)*R:LT.F
C#(i)=Cos(A+g)*R:EndProcedure:EndMacro:Examine#W(s)():N=999:Dw=W(Width)(0):B=50
M D:Random(B*2)-B:O#M:Dh=W(Height)(0):M V():Sprite:O#M:Si=512:B*1000:Init#K()()
Init#V()():M Q1:DrawAlphaImage(ImageID(0),0,0):O#M:M Q:EndIf:O#M:Init#V()3D()
M E(S,T):If K()Pushed(#PB_Key_#S):T:Q:O#M:Dd=W(Depth)(0):D3=Dw/2:InitMouse():P.F
Global.F Dim X(N),Dim Y(N),Dim Z(N),H,R,A:Ro(y,z,x):D2=Dh/2:Ro(z,x,y):Ro(x,y,z)
OpenScreen(Dw,Dh,Dd,""):K()Mode(#PB_#K()_International):T=Si/2:U N:X(I)=D:RC.F
Y(I)=D:Z(I)=D:Next:CreateImage(0,Si,Si,32):M C():Start:O#M:Create#V()(0,Si,Si,4)
C()T(ImageOutput(0)):U Si/2:G=I*511/Si:Circle(T,T,(Si-(I*2))/2,RGBA(G,G,G,255))
Next:Stop#T():C()T(V()Output(0)):Q1:DrawingMode(8):Q1:Stop#T():Create#V()3D(0,0)
RA=PA:CS.F=0:Repeat:Delay(1):Examine#K()():TC.F:PC.F:ClearScreen(0):C()3D():F.F
V()3DBlendingMode(5,7):E(Return,CS+10):E(Right,RC+RA):E(Down,PC+PA):E(Up,PC-PA)
E(Tab,TC+TA):E(Left,RC-RA):E(Back,CS/1.1):E(A,TC-TA):U N:Z(I)-CS:If Z(I)<-B:PT.F
Z(I)+B*2:Q:Rx(I,PC):Ry(I,TC):Rz(I,RC):F=400/Z(i):If Z(i)>0:Display#V()3D(0,0,0)
L.F=X(i):P=Y(i):X1=D3+(L-T)*F:Y1=D2+(P-T)*F:Y2=D2+(P-T)*F:J=F*100:PT=P+T:LT=L+T
Transform#V()3D(0,X1,Y1,J,D3+LT*F,Y2,J,D3+LT*F,D2+PT*F,J,D3+(L-T)*F,D2+PT*F,J)
Q:Next:PC*0.9:TC*0.9:RC*0.9:Stop3D():FlipBuffers():E(Escape,O):ForEver
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PurePunch Contest #5

Post by djes »

Yeah, what a nice starfield! :D

However, could you conform to the rules for the header and the pb version?

I'm sure you, and certainly other, prefer the old lines limit, as it's challenging, but for this contest, it was not a necessity. Do you think we should go back?
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: PurePunch Contest #5

Post by Olliv »

No, no... It is just for the fun. It's not the first time I don't follow the rules in this contest (Cf Tetris).

I had a little disease (une ***, mais alors une *** à défier la gravitation universelle...) and I used the time at home to make this.

Ollivier
Last edited by Olliv on Mon Oct 26, 2009 2:04 am, edited 1 time in total.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PurePunch Contest #5

Post by djes »

Ok! :lol: (tu es sûr que n'as pas été aspiré là? :mrgreen:)
dige
Addict
Addict
Posts: 1405
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PurePunch Contest #5

Post by dige »

Amazing :shock: how can it be done with 20 line of codes?????
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PurePunch Contest #5

Post by djes »

Skills ;)

I'll keep this code for the next month contest, hoping that PB4.40 will be released. Prepare yourself for a return to the Punch's roots!
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PurePunch Contest #5

Post by djes »

As there's not enough entries (only two in the french forum), I've decided to give one month more to the competitors. I'll change the rules to allow the use of the new PB version.
Nituvious
Addict
Addict
Posts: 1029
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: PurePunch Contest #5

Post by Nituvious »

I wish I was good enough to enter into the contest! I'd love to do such a thing.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PurePunch Contest #5

Post by djes »

Just try, maybe you'll impress yourself! There's also a beginner category to start.
Nituvious
Addict
Addict
Posts: 1029
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: PurePunch Contest #5

Post by Nituvious »

djes wrote:Just try, maybe you'll impress yourself! There's also a beginner category to start.
Okay, I will see if I can come up with something! :)
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: PurePunch Contest #5

Post by Vera »

Hi djes,

thanks for the datafile :)
and especially for the extra-month as I got carried away by other things to do, but I still try to proceed ;)

greetings ~ Vera
Post Reply