Microsoft Small Basic Code Examples

Microsoft Small Basic Code Examples Rating: 4,0/5 9564 reviews

Microsoft announced Small Basic in October 2008, and released the first stable version for distribution on July 12, 2011 on a (MSDN) website with a teaching curriculum and an introductory guide. Between announcement and stable release, a number of (CTP) releases were made. On March 27, 2015, Microsoft released Small Basic version 1.1, which fixed a bug and upgraded the targeted version from version 3.5 to version 4.5. Microsoft released Small Basic version 1.2 on October 1, 2015. Version 1.2 was the first update after a four-year hiatus to introduce new features to Small Basic.

Tetris in Microsoft Small Basic: Tetris.md Explore Channels Plugins & Tools Pro Login About Us. Report Ask Add Snippet. By kasajian @ kasajian 0. Pearl of Wisdom. Click on the embed code to copy it into your clipboard Width Height.

The update added classes for working with Microsoft's motion sensors, increased the number of languages supported by the included Dictionary object, and fixed a number of bugs. Language [ ] In Small Basic, one writes the illustrative as follows. Write ( 'Enter the temperature today (in F): ' ) temp = TextWindow. ReadNumber () If temp > 100 Then TextWindow.

WriteLine ( 'It is pretty hot.' ) ElseIf temp > 70 Then TextWindow. WriteLine ( 'It is pretty nice.' ) ElseIf temp > 50 Then TextWindow.

WriteLine ( 'Don't forget your coat.' ) Else TextWindow.

WriteLine ( 'Stay home.' ) EndIf Looping [ ] This example demonstrates a loop. Starting from one and ending with ten, it multiplies each number by four and displays the result of multiplication. WriteLine ( 'Multiplication Tables' ) For i = 1 To 10 TextWindow. Write ( i * 4 ) EndFor are also supported, and the demonstrated can be augmented through the use of the Step keyword. The Step keyword is used in setting the value by which the counter variable, i, is incremented each iteration. Data types [ ] Small Basic supports basic, like, and, and will readily convert one type to another as required by the situation.

In the example, both the Read and ReadNumber methods read a string from the command line, but ReadNumber rejects any non-numeric characters. This allows the string to be converted to a numeric type and treated as a number rather than a string by the + operator. WriteLine ( Math. Log ( '100' )) 'Prints 2 TextWindow. WriteLine ( '100' + '3000' ) ' Prints 3100 TextWindow. WriteLine ( 'Windows ' + 8 ) ' Prints Windows 8 TextWindow.

Metroid fusion cheats and cheat codes for gba ruby. WriteLine ( Text. GetLength ( 1023.42 )) ' Prints 7 (length of decimal representation including decimal point) In the second example, both strings are treated as numbers and added together, producing the output 3100. To the two values, producing the output 1003000, it is necessary to use the Text.Append( text1, text2) method. Libraries [ ] Standard library [ ] The Small Basic includes basic classes for mathematics,, and, as well as more exotic classes that are intended to make using the language more fun for learners.

Examples of these include a class, a class for retrieving photos from, and classes for interacting with Microsoft Kinect sensors. To make the classes easier to use for learners, they have been simplified.

This simplification is demonstrated through the code used to retrieve a random mountain-themed image from Flickr. For i = 1 to 4 Turtle. Move ( 100 ) ' Forward 100 pixels Turtle.

Turn ( 90 ) ' Turn 90 degrees right EndFor More complex drawings are possible by altering the turning angle of the turtle and the number of iterations of the loop. For example, one can draw a by setting the turn angle to 60 degrees and the number of iterations to six. Third-party libraries [ ] Small Basic allows the use of third-party libraries.