> Pixels à ma gloire
Publié : lun. 03/janv./2011 21:33
Code : Tout sélectionner
InitSprite()
InitMouse()
InitKeyboard()
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )
Global dw.w,dh.w
If ExamineDesktops()
dw.w=DesktopWidth(0)
dh.w=DesktopHeight(0)
Else
dw.w=1024
dh.w=768
EndIf
xx1=Random(dw-1-179)
yy1=Random(dh-1-73)
xx2=Random(dw-1-179)
yy2=Random(dh-1-73)
nb=8290
nb2=0
cmb=0
;;;;;;;;;;;
Dim x.f(9)
Dim y.f(9)
nombre=9
Dim oux.w(20)
Dim ouy.w(20)
For i=0 To 20
oux(i)=Random(dw-1-179)
ouy(i)=Random(dh-1-73)
Next
;;;;;;;;;;;;;;
OpenScreen(dw,dh,32,"")
;LoadSprite(0,"d:\PureBasic\PB\SPH.bmp")
LoadSprite(0,"SPH.bmp")
DisplaySprite(0,0,0)
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
Global Dim p.w(nb,5000)
Procedure bspline(x0,y0,x1,y1,x2,y2,x3,y3,n,cmb)
For z = 0 To 149
t1.f = z/150
t2.f = t1*t1
t3.f = t1*t1*t1
k1.f = 1 - 3*t1 + 3*t2 - t3
k2.f = 4 - 6*t2 + 3*t3
k3.f = 1 + 3*t1 + 3*t2 - 3*t3
xfinal.f = (x0 * k1 + x1 * k2 + x2 * k3 + x3 * t3) / 6
yfinal.f = (y0 * k1 + y1 * k2 + y2 * k3 + y3 * t3) / 6
p(cmb,9+z*2+n*300)=xfinal
p(cmb,10+z*2+n*300)=yfinal
Next z
EndProcedure
StartDrawing(ScreenOutput())
For u=0 To 73
For i=0 To 179
x=Point(i,u)
If x<>0
cmb+1
p(cmb,0)=i
p(cmb,1)=u
p(cmb,2)=Red(x)
p(cmb,3)=Green(x)
p(cmb,4)=Blue(x)
p(cmb,5)=-Random(Random(Random(1000)+300))-1500+Random(Random(1500))
p(cmb,6)=xx1
p(cmb,7)=yy1
p(cmb,8)=900
For n=0 To 9
x(n)=Random(dw-1-179)
y(n)=Random(dh-1-73)
x=Random(Random(Random(20)))
x=Random(Random(20))
x(n)=oux(x)
y(n)=ouy(x)
;x(n)=oux(Random(Random(Random(20))))
;y(n)=ouy(Random(Random(Random(20))))
Next
;*********************************************
x(0)=xx1 : y(0)=yy1
x(1)=x(0) : y(1)=y(0)
x(2)=x(0) : y(2)=y(0)
x(nombre-3)=xx2 : y(nombre-3)=yy2
x(nombre-1)=x(nombre-3) : y(nombre-1)=y(nombre-3)
x(nombre-2)=x(nombre-3) : y(nombre-2)=y(nombre-3)
For n=0 To nombre-4 ; On trace la bspline
bspline(x(n),y(n),x(n+1),y(n+1),x(n+2),y(n+2),x(n+3),y(n+3),n,cmb)
Next
;End
;*********************************************
p(cmb,9+p(cmb,8)*2)=xx2
p(cmb,10+p(cmb,8)*2)=yy2
EndIf
Next
Next
StopDrawing()
If cmb<>nb
End
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
debut:
Repeat
ClearScreen(0)
;ExamineMouse()
;*****
StartDrawing(ScreenOutput())
;;;;;;;;;;;
For i=1 To nb
If p(i,5)<>32700
p(i,5)+1
If p(i,5)=p(i,8)
p(i,5)=32700
nb2+1
EndIf
EndIf
If p(i,5)<0
Plot(p(i,6)+p(i,0),p(i,7)+p(i,1),RGB(p(i,2),p(i,3),p(i,4)))
Else
; Plot(p(i,9+p(i,8))+p(i,0),p(i,10+p(i,8))+p(i,1),RGB(p(i,2),p(i,3),p(i,4)))
If p(i,5)<>32700
Plot(p(i,9+p(i,5)*2)+p(i,0),p(i,10+p(i,5)*2)+p(i,1),RGB(p(i,2),p(i,3),p(i,4)))
Else
Plot(p(i,9+p(i,8)*2)+p(i,0),p(i,10+p(i,8)*2)+p(i,1),RGB(p(i,2),p(i,3),p(i,4)))
EndIf
EndIf
Next
;zz+1 : zz%(dw) : Plot(zz,0,RGB(0,255,0))
;;;;;;;;;;;
StopDrawing()
;*****
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
End
En parlant de psychiatrie, je trouve que tu deviens de plus en plus agressif, ces derniers temps; un peu de politesse et de respect pour le travail d'autrui (même s'il ne marche pas sur ton PC) ne fait jamais de mal. Une bonne résolution pour 2011, peut-être ?Dobro a écrit :encore un code de m***
MERCI (tu vois, la, tu ne peux pas dire que je te zapflaith a écrit :té ré jo li
Alors la, encore un truc inexplicable car :PS1 :
chez moi la partie de code :
Code:
If cmb<>nb
End
EndIf
s'exécutait systematiquement... alors Forcement ...
PS2 :
ps: j'ai du modifier nb=8290 en nb=8292 sinon out of table
Tu te trompe TOTALEMENTDobro a écrit :SPH a écrit : Alors la, encore un truc inexplicable car :
Mon logo possede 8290 points non noir et pas un de plus. Et donc, je teste pour voir si c'est le bon logo. Une sorte de MD5 quoi.
Donc, va falloir m'expliquer comment tu en detectes 2 de plus !!!!!![]()
![]()
là n'est pas le probleme !
le probleme c'est que tu declare un tableau avec 8290 elements
et que plus loin dans ton code ligne 64 ; ça plante :
Code : Tout sélectionner
cmb+1 p(cmb,0)=i ;<<<<<<< ici ça plante Cmb indique 8291 !!!!
Faudrais savoir !!!! Tu as dis dans ton premier post que c'etait un code de M**** qui ne fonctionnait pas !!Dobro a écrit : ps : ton code du zip fonctionne chez moi .. mais il n'est pas centré ..
ta demo ne s'affiche pas entierement sur mon 1024X600
SPH a écrit : Tu te trompe TOTALEMENT. C'est une mesure anti triche que j'ai fait et on ne peux pas depasser 8290 avec mon logo. DONC : soit ca marche, soit tu as essayer un autre logo. POINT
![]()
![]()
Code : Tout sélectionner
;LoadSprite(0,"d:\PureBasic\PB\SPH.bmp")
LoadSprite(0,"SPH.bmp")
DisplaySprite(0,0,0)