NonSense Code like this

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

above a fire-generator
Should be a tool to show CPU-Activity.

Code: Select all

 ;random number generator by El_Choni
Global result.l
max.l
seed.l ;= 5555    0
     End
    EndIf
    Delay(20+MyRandom(100))
    Gosub MakeFlames  
    If EventID=#PB_EventGadget 
     GI=EventGadgetID() 
     If GI =0
      Quit=1
     EndIf
    EndIf
    If EventID = #PB_EventRepaint   ; If the user has resized the window or anything, we will repaint our graphic
      ;Gosub SomeGraphics
      ;Gosub MakeFlames 
     EndIf
    If EventID = #PB_EventCloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf
  Until Quit = 1
  
EndIf

End   ; All the opened windows are closed automatically by PureBasic
 


MakeFlames:
StartDrawing(WindowOutput())
For Y = 50 To 4 Step -1
 For X = 0 To 50
  ;set the random degree of cooldown
  FlameArray(X, Y) = FlameArray(X, Y) - MyRandom(* 3)
  ;set a new random number For the movement
  temp2 = MyRandom(* 3)
  ;move the pixel in the array
  FlameArray(X, Y - temp2) = FlameArray(X, Y)
  ;get the color based on the "heat" value
  Color = FlameArray(X, Y) * temp
  R1=2*Color
  If R1>255 
   R1=255
  EndIf
  If R1255
   G1=255
  EndIf
  If G1<0 
   G1=0
  EndIf
  B1=20
  FrontColour(R1,G1,B1)
  Plot (X,Y)
 Next X
Next Y
StopDrawing()

;make the bottom 4 rows hot again
For X = 0 To 50
For Y = 46 To 50
FlameArray(X, Y-4) = 50
Next Y
Next X

Return
Getting better with a little help from my friends....thx Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Mhhhh... nice but little small example... Seems it works only correct, when the debugger is enabled... If debuffer is disabled, there will nothing happen... (it will not change the gfx) ...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
Mhhhh... nice but little small example... Seems it works only correct, when the debugger is enabled... If debuffer is disabled, there will nothing happen... (it will not change the gfx) ...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
as i say its nonsense, but i have no debugger enabled and it works (Win-NT SP6)


Getting better with a little help from my friends....thx Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.
Rings wrote:
as i say its nonsense, but i have no debugger enabled and it works (Win-NT SP6)
Mhhh... i tested with fullversion of PB2.90 for Windows on my following system and works only when debugger is enabled - mhhh...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

very crazy on a nonsense code.works perfect on win2000 too.It seem that win98 is a lame OS :wink:
of coz i will test it under linux too...........

(german-> geht nicht gegen dich Thorsten)

Getting better with a little help from my friends....thx Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.

it works fine on my Windoze'98

elecTRONics DOCtor
{registeredPB}P150 32Mb w98/DOS/Linux NO DirX NO IE :wink:
Post Reply