Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Image-noise/FreeBASIC/image-noise.basic
Normal file
36
Task/Image-noise/FreeBASIC/image-noise.basic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
' version 13-07-2018
|
||||
' compile with: fbc -s console
|
||||
' or: fbc -s gui
|
||||
|
||||
' hit any to key to stop program
|
||||
|
||||
Randomize Timer
|
||||
Screen 13
|
||||
|
||||
If ScreenPtr = 0 Then
|
||||
Print "Error setting video mode!"
|
||||
End
|
||||
End If
|
||||
|
||||
Palette 0, 0 ' black
|
||||
Palette 1, RGB(255, 255, 255) ' white
|
||||
|
||||
Dim As UInteger c, x, y, Col
|
||||
Dim As Double fps, t = Timer
|
||||
|
||||
' empty keyboard buffer
|
||||
While InKey <> "" : Wend
|
||||
|
||||
While InKey = ""
|
||||
|
||||
For x = 0 To 319
|
||||
For y = 0 To 199
|
||||
' color is as integer, a float gets rounded off by FreeBASIC
|
||||
PSet(x, y), Rnd
|
||||
Next
|
||||
Next
|
||||
c += 1
|
||||
fps = c / (Timer - t)
|
||||
WindowTitle "fps = " + Str(fps)
|
||||
|
||||
Wend
|
||||
Loading…
Add table
Add a link
Reference in a new issue