ChatterBox

BlitzPlus Forums/BlitzPlus Beginners Area/ChatterBox

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is a heavily commented but not indented program.
I just made it.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MidNum - A program that generates the number ;;
;;that is in the middle of two other numbers...;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Sets the screen size to 800X600 pixels, lets Blitz choose the resolution, and makes it a windowed program
Graphics 800,600,0,2
;Make the title of the program "MidNum Generator"
AppTitle "MidNum Generator"

;Tells the user what to do
Print "Welcome to the MidNum Generator, please type in a number."
;Gets the input from the user
Global num1=Input("")
;Tells the user what to do next
Print "Now type in another number. The MidNum Generator will"
Print "find the middle of the two numbers you typed in."
Global num2=Input("")
;Calls the user defined function, FindMidNum()
Newnum=FindMidNum()
;Prints the Middle Number
Print newnum
;Waits 5000 milliseconds (5 seconds) so the user has time to see the number
Delay 5000
;Starts the function FindMidNum()
Function FindMidNum()
;Does the math to find the middle number - Adds up the two numbers and divides by two
Return (num1+num2)/2
;Ends the Function, FindMidNum()
End Function
;Ends the program so that if you didn't compile it, you won't get that annoying "Program has ended" dialog
End