Season's Greetings PurePunch contest

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Season's Greetings PurePunch contest

Post by djes »

~ December 2012 ~

Season's Greetings PurePunch contest

The contest is now OVER, please vote here : http://www.purebasic.fr/english/viewtop ... 14&t=52694

Theme
  • The fantastic PB 5.00 Demo !
    Show your skills thanks to the new PureBasic version. This demonstration could be an utility, a game, a 3D graphical demonstration, whatever you're able to do with the new PureBasic version, while pushing the limits !
    May the best win !
Gifts & Sponsors
  • Fred and Fantaisie software are happy to sponsor the contest :
  • First prize : a PureBasic Teddy Bear !
  • Second prize : a PureBasic Mug
  • Third prize : a PureBasic Mousepad
    If you want also to be a sponsor, please contact me.
The rules
  • 1° The program will be created using Purebasic 5.00 (minimum), API allowed, demo version allowed, no userlib.
    2° The program source will only have a maximum of 80 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° 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", "Message", #PB_MessageRequester_Ok)
    Time limit : Dec 31st, 2012 @ 11:59pm
  • At the end of this period, a topic will be created to vote for the best code (only people registered in the forum before Nov 27th are allowed to vote). To maintain suspense, you'll be asked to give 3 points for your favorite, two for the second, one for the third. The vote will take place from Jan 1st, 2013 to Jan 14th @ 23:59. After verification, winners will be contacted to receive their prizes.
How to post
  • Post the code on this forum, after adding and completing the following header:

Code: Select all

;*****************************************************************************
;*
;* Season's Greetings PurePunch Demo contest
;* PureBasic 5.00
;* 80 lines of 80 chars, 1 month delay
;*
;* Name     :  
;* Author   : 
;* Date     : 
;* Notes    :
;*
;*****************************************************************************
Good luck to all players ! :) :)

PS : All 'official' forum's topics about PurePunch
Last edited by djes on Tue Jan 01, 2013 11:02 pm, edited 11 times in total.
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Re: Season's Greetings PurePunch Demo contest

Post by kenmo »

It's been a while, I will try to enter something :)
User avatar
BasicallyPure
Enthusiast
Enthusiast
Posts: 539
Joined: Thu Mar 24, 2011 12:40 am
Location: Iowa, USA

Re: Season's Greetings PurePunch Demo contest

Post by BasicallyPure »

Question,
djes wrote:2° The program source will only have a maximum of 80 lines of 80 characters max per line.
Can a line have colons ":" and still be counted as a single line?

B.P.
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Season's Greetings PurePunch Demo contest

Post by idle »

yes BP you can use colons and any tricks you desire to aid punching you creation into the format
have a look at previous punches search for purepunch
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 670
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Season's Greetings PurePunch Demo contest

Post by Kurzer »

Yes, BasicallyPure. Maybe you will have a look at one of the previous contests?
There are some tricks to write "small" code (e.g. using macros).
http://www.purebasic.fr/english/viewtop ... 12&t=38908
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
BasicallyPure
Enthusiast
Enthusiast
Posts: 539
Joined: Thu Mar 24, 2011 12:40 am
Location: Iowa, USA

Re: Season's Greetings PurePunch Demo contest

Post by BasicallyPure »

Thanks idle,
Thanks kurzer.

I'm going to assume that the 12 lines for the header don't count as part of the 80 lines.

B.P.
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: Season's Greetings PurePunch Demo contest

Post by citystate »

that's right BP. At least, that's how it's been in previous punches
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Season's Greetings PurePunch Demo contest

Post by djes »

Citystate is right.

Good news : Fred will sponsor the contest, so there will be some prizes for the winner :)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Season's Greetings PurePunch Demo contest

Post by djes »

Prize list is ready :)
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: Season's Greetings PurePunch Demo contest

Post by Sveinung »

Shall we post our contributions here in this thread?

Regards
Sveinung
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Season's Greetings PurePunch Demo contest

Post by c4s »

Maybe it would be better if the contributions wouldn't be posted in public (just PM to djes?!) until the contest has finished. This way people won't steal code/ideas from others ( ;-) ) and won't be demotivated too fast if someone made a uber-cool contribution...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: Season's Greetings PurePunch Demo contest

Post by electrochrisso »

c4s wrote:Maybe it would be better if the contributions wouldn't be posted in public (just PM to djes?!) until the contest has finished. This way people won't steal code/ideas from others ( ;-) ) and won't be demotivated too fast if someone made a uber-cool contribution...
I am with you c4s. :wink:
PureBasic! Purely the best 8)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Season's Greetings PurePunch Demo contest

Post by djes »

The only thing asked is that the code be posted in this forum (or by PM OK) before the Dec 31st @ 12:59pm. If you're posting before, your code may inspire the other, change the whole competition, heighten the difficulty or demotivate, of course ! But wait and maybe you're doing the same thing someone else, maybe better, maybe a little bug and your code does not work, and the users cannot tell you !

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

Re: Season's Greetings PurePunch Demo contest

Post by djes »

Two first codes by french forum users :

Code: Select all

;*****************************************************************************
;*
;* Season's Greetings PurePunch Demo contest
;* PureBasic 5.00
;* 80 lines of 80 chars, 1 month delay
;*
;* Name     : Line Counter & Longest line  
;* Author   : falsam
;* Date     : 29.11.2012
;* Notes    : off contest - copy code to test in the clipboard
;*
;*****************************************************************************
B$=GetClipboardText():E$=#CRLF$:For i=1 To CountString(B$,E$)+1:L+1
If Len(StringField(B$,i,E$))>C:C=Len(StringField(B$,i,E$)):EndIf:Next
Debug "Line Counter "+Str(L):Debug "Longest line : "+Str(C)

Code: Select all

;*****************************************************************************
;*
;* Season's Greetings PurePunch Demo contest
;* PureBasic 5.00
;* 80 lines of 80 chars, 1 month delay
;*
;* Name     : Pure4Power
;* Author   : cederavic
;* Date     : 12/01/2012
;* Notes    : Hmmm... Better to play with two players!
;*          : media.png can be downloaded here : http://slimevoid.net/games/pure4power/media.png
;*
;*****************************************************************************
#width=512:#height=440
Global Dim g(6,5),tu=1,pw=-1,Dim f(6,5):Declare checkWin()
InitSprite():UsePNGImageDecoder():UsePNGImageEncoder()
OpenWindow(0,0,0,#width,#height,"Pure4Power",13107201)
CanvasGadget(0,0,0,#width,#height,#PB_Canvas_ClipMouse)
media=LoadImage(#PB_Any,"media.png")
GrabImage(media,0,0,0,512,440)
GrabImage(media,1,0,440,72,72)
GrabImage(media,2,72,440,72,72)
LoadFont(0,"Consolas",22,#PB_Font_HighQuality|#PB_Font_Bold)
playertuTime=ElapsedMilliseconds()
Repeat:Repeat:wEvent=WindowEvent():If wEvent=16:quit=#True:EndIf
If wEvent=#WM_LBUTTONUP And dp=#False:If pw=0
dropCol=Int((WindowMouseX(0)-8)/72)
If g(dropCol,0)=0:dp=#True:dy=0:EndIf:Else:FreeArray(g()):Global Dim g(6,5)
tu=1:pw=0:EndIf:EndIf:Until wEvent=#Null:If dp=#True:dy+12
cr=Int((dy-8)/72)+1:If cr=6:dp=#False:g(dropCol,cr-1)=tu:checkWin()
If tu=1:tu=2:Else:tu=1:EndIf:playertuTime=ElapsedMilliseconds():Else
If g(dropCol,cr) > 0:dp=#False:g(dropCol,cr -1)=tu:checkWin()
If tu=1:tu=2:Else:tu=1:EndIf
playertuTime=ElapsedMilliseconds():EndIf:EndIf:EndIf
StartDrawing(CanvasOutput(0))
DrawingMode(#PB_2DDrawing_Gradient):LinearGradient(0,0,0,#height)
BackColor(RGBA(182,180,255,255)):FrontColor(RGBA(100,182,255,255))
Box(0,0,#width,#height,RGBA(0,42,224,255)):If (dp=#True)
DrawAlphaImage(ImageID(tu),dropCol * 72+4,dy+4):ElseIf (pw=0)
DrawAlphaImage(ImageID(tu),Int((WindowMouseX(0)-8)/72) * 72+4,4,128)
EndIf:For x=0 To 6:For y=0 To 5:If (g(x,y) > 0):If (pw=0)
DrawAlphaImage(ImageID(g(x,y)),x * 72+4,y * 72+4):Else
DrawAlphaImage(ImageID(g(x,y)),x * 72+4,y * 72+4,63+f(x,y) * 192)
EndIf:EndIf:Next:Next:DrawAlphaImage(ImageID(0),0,0)
DrawingMode(#PB_2DDrawing_Transparent|#PB_2DDrawing_AlphaBlend)
DrawingFont(FontID(0)):If (pw > 0)
text.s="Player "+Str(pw)+" has won!"
DrawText(#width/2-TextWidth(text)/2+2,126,text,RGBA(32,32,32,127))
DrawText(#width/2-TextWidth(text)/2,128,text,RGBA(42,241,64,255))
text.s="Click to play again"
DrawText(#width/2-TextWidth(text)/2+2,126+48,text,RGBA(32,32,32,127))
DrawText(#width/2-TextWidth(text)/2,128+48,text,RGBA(42,241,64,255))
ElseIf (pw=0):If (ElapsedMilliseconds()-playertuTime < 3000)
alpha.f=255-(255 * (ElapsedMilliseconds()-playertuTime)/3000.0)
text.s="Player "+Str(tu)+" turn"
If tu=1:color=RGBA(255,174,0,alpha):Else:color=RGBA(255,16,16,alpha):EndIf
DrawText(#width/2-TextWidth(text)/2+2,126,text,RGBA(32,32,32,(alpha/2)))
DrawText(#width/2-TextWidth(text)/2,128,text,color):EndIf:Else
text.s="Click to Play"
DrawText(#width/2-TextWidth(text)/2+2,126,text,RGBA(32,32,32,127))
DrawText(#width/2-TextWidth(text)/2,128,text,RGBA(242,180,100,255))
EndIf:StopDrawing():Until quit=#True:End
Procedure p(x,y,dx,dy,player,win):If x<0 Or x>6 Or y<0 Or y>5
ProcedureReturn win:EndIf:If g(x,y)<>player:ProcedureReturn win:EndIf
If g(x,y)=player:f(x,y)=1:ProcedureReturn p(x+dx,y+dy,dx,dy,player,win+1):EndIf
EndProcedure
Procedure checkWin():For x=0 To 6:For y=0 To 5:If (g(x,y) > 0)
For dx=-1 To 1:For dy=-1 To 1:If (dx <> 0 Or dy <> 0):FreeArray(f())
Global Dim f(6,5):If p(x,y,dx,dy,g(x,y),0) >= 4
pw=g(x,y):ProcedureReturn pw:EndIf:EndIf:Next:Next:EndIf
Next:Next:ProcedureReturn 0:EndProcedure
With this picture : Image
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: Season's Greetings PurePunch Demo contest

Post by electrochrisso »

Code: Select all

;*****************************************************************************
;*
;* Season's Greetings PurePunch Demo contest
;* PureBasic 5.00
;* 80 lines of 80 chars, 1 month delay
;*
;* Name     : Meal Master Quickview
;* Author   : electrochrisso
;* Date     : 04.12.2012
;* Notes    : Download Recipes Here: http://home.earthlink.net/~darkstar105/
;*
;*****************************************************************************
OpenWindow(0,100,0,842,540,"Meal Master Quickview",#PB_Window_SystemMenu)
CreateToolBar(0,WindowID(0)):ToolBarStandardButton(0,#PB_ToolBarIcon_Open)
ListViewGadget(0,0,28,200,512)
EditorGadget(1,202,28,640,512,#PB_Editor_ReadOnly)
SetGadgetColor(0,#PB_Gadget_BackColor,$FAFFF5)
SetGadgetColor(1,#PB_Gadget_BackColor,$F0FFFF)
SetGadgetFont(1,LoadFont(0,"Courier",10))
Repeat:Select WaitWindowEvent():Case #PB_Event_Menu:Select EventMenu()
Case 0:f$=OpenFileRequester("Open Menu Master File","","Text (*.txt)",0)
If f$:If ReadFile(0,f$):ClearGadgetItems(0):SetGadgetText(1,""):Repeat
a$=ReadString(0):If Left(a$,12)="      Title:":AddGadgetItem(0,-1,Mid(a$,13))
EndIf:Until Eof(0):CloseFile(0):EndIf:EndIf:EndSelect
Case #PB_Event_Gadget:Select EventGadget():Case 0:If ReadFile(0,f$)
Repeat:a$=ReadString(0)
Until a$=Left(a$,12)+GetGadgetItemText(0,GetGadgetState(0))
While a$<>"MMMMM":If a$<>"MMMMM":b$+a$+#CRLF$:a$=ReadString(0):EndIf:Wend
CloseFile(0):EndIf:SetGadgetText(1,b$):b$="":EndSelect
Case #PB_Event_CloseWindow:End:EndSelect:ForEver
PureBasic! Purely the best 8)
Post Reply