Il est cool ton jeu huitbit


J'adore son aspect bien rétro
J'adooore
http://www.purebasic.fr/french/viewtopi ... =2&t=13708Lemaquis a écrit :au moins tu as crée un jeux pas comme SPH
et alors j'ai horreur du scrabble jeux pour les vieuxSPH a écrit :http://www.purebasic.fr/french/viewtopi ... =2&t=13708Lemaquis a écrit :au moins tu as crée un jeux pas comme SPH
Code : Tout sélectionner
;*****************************************************************************
;*
;* July-August 2014 PurePunch contest
;* PureBasic 5.22
;* 50 lines of 80 chars, 2 months delay
;*
;* Name : Microdevweb / Bielen Pierre
;* Author : Microdevweb / Bielen Pierre
;* Date : 30-08-2014
;* Notes : Statistique loto Belge
;*
;*****************************************************************************
Structure Tirage:List Num$():EndStructure:Global NewMap myTirage.Tirage()
InitNetwork()
ReceiveHTTPFile("http://www.loterie-nationale.be/Controls/Draw/"+
"DownloadResults.ashx?productId="+
"cb2916c1-fea5-49ae-9576-a478249aa07f&StartDate"+
"=20040101&EndDate=20151201&ExportData=True","re.csv")
OpenFile(0,"re.csv"):ReadString(0):While Eof(0)=0:Txt$=ReadString(0):Nb+1:
AddMapElement(myTirage(),Str(Nb)):For N=2 To 8
AddElement(myTirage()\Num$()):myTirage()\Num$()=StringField(Txt$,N,";"):Next
Wend
CloseFile(0)
OpenWindow(0,0,0,800,600,"Loto",#PB_Window_Maximize|#PB_Window_SystemMenu):
W=WindowWidth(0):H=WindowHeight(0)
CanvasGadget(0,0,0,W,30):ScrollAreaGadget(1,0,30,W,H-30,W-5,Nb*20):
CanvasGadget(2,0,0,W,Nb*20):CloseGadgetList()
SetGadgetAttribute(1,#PB_ScrollArea_InnerWidth,W-10):
SetGadgetAttribute(1,#PB_ScrollArea_InnerHeight,Nb*20)
WB=(W-100)/45:StartDrawing(CanvasOutput(0)):Box(0,0,W,30,$00D7FF):X=50
For N=1 To 45
DrawText(X,10,Str(N),$000000,$00D7FF):X+WB:Next:StopDrawing()
StartDrawing(CanvasOutput(2)):Box(0,0,W,Nb*20,$D3D3D3)
X=40
Box(X,0,W-100,Nb*20,$0000FF)
For N=1 To 45
Y=0
For R=Nb To 1 Step -1
ForEach myTirage(Str(R))\Num$()
If Val(myTirage(Str(R))\Num$())=N
Box(X,Y,WB,20,$2FFFAD)
EndIf
Next
DrawText(0,Y,Str(R),$000000,$D3D3D3)
Line(0,Y,W-60,1,$000000)
Y+20
Next
Line(X,0,1,Nb*20,$000000)
X+WB
Next
StopDrawing()
Repeat: :Until WaitWindowEvent()=#PB_Event_CloseWindow
Voila ce que ça faitEdit par TazNormand
Réduction de ton code aux normes 80 colonnes à l'arrache
Code : Tout sélectionner
OpenFile(0,"D:\PurePunch\Loto.pb")
N=0
While Eof(0)=0
Txt$=ReadString(0)
N+1
Debug "Ligne: "+Str(N)+" Nbr Caractères: "+Str(Len(Txt$))
Wend
CloseFile(0)