Post by xxgeek on Jun 8, 2023 14:01:04 GMT
Many years ago I came across a little assembly program that allows the user to create particles in space, add a sun, or blackhole, define the gravity of the sun, blackhole and particles, then watch it evolve.
www.grc.com/wizmo/wizmo.htm
Not all of the possible wizmo commands are being utilized.
Many of these commands deal with display, hibernation, monitors, shutdown, reboot......etc.
The GUI ONLY utilizes the commands for the screensaver/graphics capabilities.
I liked playing with this and trying different values, but it was cumbersome creating the shortcuts.
Just recently I put together a GUI to make it a bit easier to make changes, and run it again, and again.
All you need to do is goto the website above and download wizmo, and then put it in the same folder as the .bas file created with the code below.
Run the code, plug in some values, and hit the Run button.
Don't move your mouse, or touch any keys until you want it to stop.
The possible systems are infinite.
This is another example of what can be done with Just Basic.
Using the command line of an exe file, we can create our own GUI's
Have fun!
P.S. If their is any interest in creating a GUI for the other commands wizmo will accept I would consider working on it.
If you find a glitch, please report it.
www.grc.com/wizmo/wizmo.htm
Not all of the possible wizmo commands are being utilized.
Many of these commands deal with display, hibernation, monitors, shutdown, reboot......etc.
The GUI ONLY utilizes the commands for the screensaver/graphics capabilities.
I liked playing with this and trying different values, but it was cumbersome creating the shortcuts.
Just recently I put together a GUI to make it a bit easier to make changes, and run it again, and again.
All you need to do is goto the website above and download wizmo, and then put it in the same folder as the .bas file created with the code below.
Run the code, plug in some values, and hit the Run button.
Don't move your mouse, or touch any keys until you want it to stop.
' A GUI for wizmo - https://justbasiccom.proboards.com/thread/1011/different-gui-wizmo?page=1&scrollTo=7283
'Created by xxgeek @ - https://justbasiccom.proboards.com/thread/1011/different-gui-wizmo?page=1&scrollTo=7277
'Put the wizmo.exe file into the same folder as the ,bas or .tkn file created with the code below
ver$ = "v1.1"
dim line$(500)
nomainwin
WindowWidth = 700
WindowHeight = 600
UpperLeftX = int((DisplayWidth-WindowWidth)/2)
UpperLeftY = int((DisplayHeight-WindowHeight)/2)
groupbox #main.boundary,"Screen Boundary",270,15,70,125
radiobutton #main.solid,"Solid",[setStop],[setStop],280,40,40,25
radiobutton #main.elastic,"Elastic",[setElastic],[setElastic],280,70,50,25
radiobutton #main.infinite,"Infinite",[setInfinite],[setInfinite],280,100,60,25
groupbox #main.wellGroup,"Gravity Well",460,15,85,70
radiobutton #main.sun,"Sun",[setSun],[setSun],470,40,40,25
radiobutton #main.blakhole,"Black Hole",[setBlackhole],[setBlackhole],470,60,80,25
statictext #main.wellGravity, "Well Mass", 470, 95, 50, 20
textbox #main.wellText, 530, 90, 60, 20
groupbox #main.partGroup,"Particles",5,15,225,65
radiobutton #main.Particles, "Number of Particles",[setParticles],[setParticles], 10, 35, 110, 20
textbox #main.partText, 125, 35, 50, 20
statictext #main.partGravity, "Particle Mass", 50, 90, 70, 20
textbox #main.gravText, 125, 85, 50, 20
radiobutton #main.grid, "Use Particle Grid",[setGrid],[setGrid], 20, 55, 100, 20
textbox #main.griddimx, 125, 50, 40, 20
statictext #main.grid2, "X", 175, 55, 20, 20
textbox #main.griddimy, 195, 50, 40, 20
statictext #main.trails, "Trails Length", 55, 120, 70, 20
textbox #main.trailLen, 125, 115, 40, 20
checkbox #main.lineChk,"Particles in Diagonal Line ",[setline],[resetLine],15,145,140,25
button #main.default, "Run", [run],UL 270, 150, 110, 50
button #main.save, "Save Configuration", [save],UL 570, 190, 110, 30
button #main.open, "Open Config File", [open],UL 450, 190, 110, 30
button #main.del, "Select an Item to Delete", [delItem],UL 50, 205, 140, 30
statictext #main.shake, "Mouse Sensitivity", 470, 150, 90, 20
textbox #main.shakeNum, 560, 145, 40, 20
statictext #main.header, "Select a Saved Configuration", 270, 225, 150, 15
listbox #main.configs, configsList$(, [configSelected], 05, 240, 690, 360
open "Wizmo GUI ";ver$ for dialog_modal_nf as #main
#main "trapclose [quit]"
linne$ = "noline"
#main.shakeNum "50"
#main.solid "set"
#main.griddimx "!hide"
#main.griddimy "!hide"
#main.grid2 "!hide"
#main.Particles "set"
#main.default "!font 12"
#main.configs "font 11 bold"
#main.configs "singleclickselect"
gosub [getConfigs]
'#main.configs "reload"
wait
[run]
gosub [getValues]
if shaik$ = "" or val(shaik$) = 0 then shaik$ = "50"
run "wizmo particles=";val(parts$);" grid=";val(dimx$);",";val(dimy$);" gravity=";val(grav$);" ";bound$;" ";linne$;" trails=";val(trail$);" ";well$;wellMass$;" quiet shake=";val(shaik$);" graviton"
wait
[setStop]
bound$ = "stop"
wait
[setElastic]
bound$ = "elastic"
wait
[setInfinite]
bound$ = "infinite"
wait
[setSun]
well$ = "sun="
wait
[setBlackhole]
well$ ="blackhole="
wait
[setline]
linne$ = "line"
wait
[resetLine]
linne$ = ""
wait
[setParticles]
#main.griddimx ""
#main.griddimy ""
#main.partText "!show"
#main.griddimx "!hide"
#main.griddimy "!hide"
#main.grid2 "!hide"
wait
[setGrid]
#main.partText ""
#main.partText "!hide"
#main.griddimx "!show"
#main.griddimy "!show"
#main.grid2 "!show"
wait
[open]
if fileExists(DefaultDir$, "configs.txt") then run "notepad ";DefaultDir$;"\configs.txt" else notice "No Config File Created Yet"
wait
[save]
gosub [getValues]
if val(shaik$) = 0 or shaik$ = "" then shaik$ = "50"
open "configs.txt" for append as #1
#1 "wizmo particles=";val(parts$);" grid=";val(dimx$);",";val(dimy$);" gravity=";val(grav$);" ";bound$;" ";linne$;" trails=";val(trail$);" ";well$;wellMass$;" quiet shake=";val(shaik$);" graviton"
close #1
redim configsList$(500)
gosub [getConfigs]
#main.configs "reload"
wait
[getConfigs]
redim configsList$(500)
if fileExists(DefaultDir$, "configs.txt") then
open DefaultDir$;"\configs.txt" for input as #1
while eof(#1) = 0
x = x + 1
line input #1, configsList$(x)
wend
close #1
end if
#main.configs "reload"
return
[configSelected]
#main.configs "selection? config$"
if config$ <> "" and delItem = 1 then
open "configs.txt" for input as #1
open "configsTemp" for output as #2
while eof(#1) = 0
line input #1, oneLine$
if oneLine$ = config$ then [notToday] else #2 oneLine$
[notToday]
wend
close #1
close #2
kill "configs.txt"
name "configsTemp" as "configs.txt"
gosub [getConfigs]
#main.configs "reload"
end if
if delItem = 0 then run config$
delItem = 0
#main.configs "select 0"
wait
[getValues]
#main.trailLen "!contents? trail$"
#main.partText "!contents? parts$"
#main.gravText "!contents? grav$"
#main.griddimx "!contents? dimx$"
#main.griddimy "!contents? dimy$"
#main.shakeNum "!contents? shaik$"
#main.wellText "!contents? wellMass$"
return
[delItem]
delItem=1
wait
[quit]
close #main
end
'function for checking file existence
function fileExists(path$, filename$)
dim info$(0, 0)
files path$, filename$, info$()
fileExists = val(info$(0, 0)) 'non zero is true
end function
'
The possible systems are infinite.
This is another example of what can be done with Just Basic.
Using the command line of an exe file, we can create our own GUI's
Have fun!
P.S. If their is any interest in creating a GUI for the other commands wizmo will accept I would consider working on it.
If you find a glitch, please report it.