woollybah 6 anni fa
parent
commit
e7b121fdc1

+ 6 - 4
random.mod/doc/rand.bmx

@@ -2,13 +2,15 @@
 ' Toss a pair of dice. Result is in the range 1+1 to 6+6.
 ' Count how many times each result appears.
 
-Local count[13]
+SuperStrict
 
-For n = 1 To 3600
-    toss = Rand(1,6) + Rand(1,6)
+Local count:Int[13]
+
+For Local n:Int = 1 To 3600
+    Local toss:Int = Rand(1,6) + Rand(1,6)
     count[toss] :+ 1
 Next
 
-For toss = 2 To 12
+For Local toss:Int = 2 To 12
     Print LSet(toss, 5)+count[toss]
 Next

+ 8 - 5
random.mod/doc/rnd.bmx

@@ -1,11 +1,14 @@
 ' Rnd.bmx
 ' Use Rnd() to estimate area inside the unit circle x^2 + y^2 = 1.
 
-totalpoints = 1000000
+SuperStrict
 
-For n = 1 to totalpoints
-    x! = Rnd( -1.0, 1.0 )               ' Generate random point in 2 by 2 square.
-    y! = Rnd( -1.0, 1.0 )
+Local totalpoints:Int = 1000000
+Local inpoints:Int
+
+For Local n:Int = 1 To totalpoints
+    Local x:Double = Rnd( -1.0, 1.0 )               ' Generate random point in 2 by 2 square.
+    Local y:Double = Rnd( -1.0, 1.0 )
 
     If x*x + y*y < 1.0 Then inpoints :+ 1     ' point is inside the circle
 Next
@@ -16,4 +19,4 @@ Print "Estimated area = " + ( 4.0 * Double(inpoints)/Double(totalpoints) )
 Print
 Print "    Exact area = " + Pi     '  4 * Pi/4, compare with estimate
 
-Input ; End
+End

+ 4 - 2
standardio.mod/doc/input.bmx

@@ -2,5 +2,7 @@ Rem
 Use the Input command to read user input from the console to a BlitzMax String.
 End Rem
 
-name$=Input("What is your name")
-print "Hello "+name
+SuperStrict
+
+Local name:String = Input("What is your name")
+Print "Hello "+name

+ 3 - 1
standardio.mod/doc/print.bmx

@@ -2,4 +2,6 @@ Rem
 Use the Print command to output BlitzMax strings to the Console window.
 End Rem
 
-Print "Hello World"
+SuperStrict
+
+Print "Hello World"

+ 3 - 1
stream.mod/doc/readstream.bmx

@@ -3,7 +3,9 @@
 ' opens a read stream to the blitzbasic.com website and
 ' dumps the homepage to the console using readline and print
 
-in=ReadStream("http::blitzbasic.com")
+SuperStrict
+
+Local in:TStream = ReadStream("http::blitzmax.org")
 
 If Not in RuntimeError "Failed to open a ReadStream to file http::www.blitzbasic.com"
 

+ 5 - 3
stream.mod/doc/writestream.bmx

@@ -3,9 +3,11 @@
 ' opens a write stream to the file mygame.ini and
 ' outputs a simple text file using WriteLine
 
-out=WriteStream("mygame.ini")
+SuperStrict
 
-if not out RuntimeError "Failed to open a WriteStream to file mygame.ini"
+Local out:TStream = WriteStream("mygame.ini")
+
+If Not out RuntimeError "Failed to open a WriteStream to file mygame.ini"
 
 WriteLine out,"[display]"
 WriteLine out,"width=800"
@@ -19,4 +21,4 @@ WriteLine out,"MAK=920"
 
 CloseStream out
 
-print "File mygame.ini created, bytes="+FileSize("mygame.ini")
+Print "File mygame.ini created, bytes="+FileSize("mygame.ini")

+ 4 - 2
systemdefault.mod/doc/confirm.bmx

@@ -1,5 +1,7 @@
 ' confirm.bmx
 
-result=Confirm("Are you sure?")
+SuperStrict
 
-print result
+Local result:Int = Confirm("Are you sure?")
+
+Print result

+ 7 - 6
systemdefault.mod/doc/createtimer.bmx

@@ -3,12 +3,13 @@ The following BlitzMax program prints a new line to the console 5 times a second
 End Rem
 
 ' testtimer.bmx
+SuperStrict
 
-t=createtimer(5)
-frame=0
+Local t:TTimer = CreateTimer(5)
+Local frame:Int = 0
 
-for i=1 to 10
-	waittimer(t)
-	print frame
+For Local i:Int = 1 To 10
+	WaitTimer(t)
+	Print frame
 	frame:+1
-next
+Next

+ 2 - 0
systemdefault.mod/doc/currentdate.bmx

@@ -1,3 +1,5 @@
 ' currentdate.bmx
 
+SuperStrict
+
 Print "The date is "+CurrentDate$()

+ 2 - 0
systemdefault.mod/doc/currenttime.bmx

@@ -1,3 +1,5 @@
 ' currenttime.bmx
 
+SuperStrict
+
 Print "The time is "+CurrentTime$()

+ 7 - 5
systemdefault.mod/doc/delay.bmx

@@ -4,8 +4,10 @@ End Rem
 
 ' testtimer.bmx
 
-for i=1 to 10
-	print frame
-	frame:+1
-	delay 100
-next
+SuperStrict
+
+For i:Int = 1 To 10
+	Print i
+	i:+1
+	Delay 100
+Next

+ 6 - 4
systemdefault.mod/doc/millisecs.bmx

@@ -2,8 +2,10 @@ Rem
 Millisecs is useful for seeding the random number generator.
 End Rem
 
-seedrnd(millisecs())
+SuperStrict
 
-for i=1 to 10
-	print rnd()
-next
+SeedRnd(MilliSecs())
+
+For Local i:Int = 1 To 10
+	Print Rnd()
+Next

+ 2 - 0
systemdefault.mod/doc/notify.bmx

@@ -1,3 +1,5 @@
 ' notify.bmx
 
+SuperStrict
+
 Notify "Hello World"

+ 4 - 2
systemdefault.mod/doc/proceed.bmx

@@ -1,5 +1,7 @@
 ' proceed.bmx
 
-result=Proceed("Are you sure you want to continue?")
+SuperStrict
 
-print result
+Local result:Int = Proceed("Are you sure you want to continue?")
+
+Print result

+ 3 - 1
systemdefault.mod/doc/requestdir.bmx

@@ -1,5 +1,7 @@
 ' requestdir.bmx
 
-path$=RequestDir("Select a Folder",CurrentDir())
+SuperStrict
+
+Local path:String = RequestDir("Select a Folder",CurrentDir())
 
 Print "directory selected was "+path

+ 4 - 2
systemdefault.mod/doc/requestfile.bmx

@@ -1,6 +1,8 @@
 ' requestfile.bmx
 
-filter$="Image Files:png,jpg,bmp;Text Files:txt;All Files:*"
-filename$=RequestFile( "Select graphic file to open",filter$ )
+SuperStrict
+
+Local filter:String = "Image Files:png,jpg,bmp;Text Files:txt;All Files:*"
+Local filename:String = RequestFile( "Select graphic file to open",filter )
 
 Print filename