Quantcast
Channel: Small Basic
Viewing all 669 articles
Browse latest View live

Small Basic Featured Program - Turtle Maze

$
0
0

This is an image only... (Click here to play the game.)

What fun! You can only do a few things though...

  1. Click Next to change the maze.
  2. Click Start to watch the Turtle go crazy as he turns left as his strategy to beat the maze. Crazy turtle! I guess it works eventually. =^)
  3. After the turtle gets the flag, you'll need to refresh the screen to start over.

You can check out the code here:

http://smallbasic.com/program/?PNC833-12

The creator of this fun program is Nonki Takahashi.

Does anyone have any feature requests for a new version from Nonki (or from you)?

I have a few requests:

  1. Can we have another button where the user gets to control the turtle? Maybe with the arrow keys?
  2. Maybe time the user so that we can compare top scores of times it took us to beat it?
  3. After the turtle finishes or we finish, could it refresh itself back to the beginning so that we could play again?
  4. Less important, but it would be interesting to add some more AI on that turtle when he tries to complete the maze (other than or in addition to the "turn right" method).

Even if we don't get more features, it's a lot of fun to see that turtle run around like that!

Thanks Nonki!

   - Tall Basic Ed


Small Basic Tutorial: Creating Your First Program

$
0
0

Today we have a guest blogger: Noah Buscher! Check out Noah's first tutorial... about your first Small Basic program.

 

Small Basic is a .NET language created by Microsoft. It allows the beginner programmer to get started creating programs right away, and does not confuse the beginner with the numerous controls found in Visual Basic Express or Visual Studio. Officially, Small Basic is just a toned-down version of Visual Basic.NET. This means that once you are done learning Small Basic, you can easily learn Visual Basic. Let’s get started on your first program in Small Basic.

 
Step 1: Set Up Small Basic

Before you begin, be sure you have Small Basic downloaded and installed. After you are done installing, open up Small Basic, and you will see an editor like this:

 

 

This window is called the IDE, or Integrated Development Environment. This is where you will write, debug, and compile your code. This also includes a great feature called IntelliSense. This allows you to write code fast and easy. Please look at the image below to get an idea of what it looks like:

 

 

To use IntelliSense, just start typing! Take a look at all the commands available to get an idea of what Small Basic is capable of. For our first program, we are going to make a program that asks the user for a number, multiplies it by five, and displays the answer to them. Type:

 
TextWindow.WriteLine("What is the Number You Want to Multiply?")
userInput = TextWindow.ReadNumber()
answer = userInput * 5
TextWindow.WriteLine("The Answer is " + answer)

This program asks for the number to multiply, and stores the input in the variable userInput. Then it multiplies the number by five and stores that answer in the variable answer. Finally, it shows a message that displays the answer to the user.

 

Pretty cool, right? Try to modify the program to multiply the number by five and then add 5 to that answer.

 

Tutorial provided by Noah Buscher and Joman Mied.

 

WINNER: Best Small Basic Contributor on TechNet Wiki - Nonki Takahashi

$
0
0
First, I'd like you to meet...
 
Nonki Takahashi's avatar 

Nonki Takahashi

 

As many of you already know, we've had a contest for Small Basic content on TechNet Wiki:

Nonki was our winner for Best Contributor. Check out the contest results here:

Now we'll take a deeper dive on Nonki's contributions...

Noah created the Small Basic article, and Nonki added topic headers (Extensions, Community, & Let's Start). Second, Noah added the TOC and a tag. The TOC is important for article navigation, the headers help you understand and break down the flow of the article (and feed into the TOC, so they also help with navigation), and tags make the article more accessible and easier to slice on.

Nonki also added this image to the Small Basic article:

In addition, Nonki translated the article into Japanese: Small Basic (ja-JP)

Nonki's second translation was Noah's article about how to build an extension using VB.NET. Here is Nonki's translation: Small Basic: VB.NET でエクステンションを作成する方法 (ja-JP)

On the article, List of Programs Made with Small Basic, Nonki added a few programs and helped identify the profiles (with links) of a few contributors:

Nonki has also authored some great articles on TechNet Wiki:

 

In conclusion, thank you to Nonki for all your contributions to the Small Basic content community! We hope that we can continue to grow Small Basic content on TechNet Wiki and help people in our pursuit of teaching programming!

Jump on in; the Wiki is warm!

   - Tall Basic Ed

 

See Also

 

Small Basic Interview - Liam McSherry (C#, C++, D, & Small Basic)

$
0
0

Welcome to our first interview where we interview folks from the Small Basic community! We're starting with the winner of our contest to write Small Basic articles on TechNet Wiki.

Liam's Profile

Liam McSherry's avatar
 

Who are you, where are you, and what do you do? What programming languages do you use?

Well, my name is Liam McSherry. I live in Edinburgh, Scotland, near the city centre. I am a programmer and web designer, although a lot of the software I write is never released (I have fairly high standards for my own software).

At the moment, I use C#, C++, and D as my programming languages of choice. However, I do have experience in a wider variety of languages. From memory, these are Python, Ruby, F#, C, PHP, JavaScript, Visual Basic 5, x86 Assembly, and Java.

 

Tell us about your history with Small Basic. How did you learn about it? What have you learned? How has it helped you grow?

Where I saw Small Basic, I cannot remember. However, at the time I had no experience in programming, and Small Basic seemed as good as place as any to start. I did so, and found it a nice way to ease into more complicated languages.

I quickly progressed on to the more mature languages, first trying Java and finding it not entirely to my liking, but then finding C#. While the two are similar, C# just felt better to me, so I looked things up about it, found resources for it, and taught myself the language.

While I still use C#, I have also "broadened my horizons," so to speak, to the aforementioned languages above.

Small Basic helped me because it helped an interest in how computers work grow, and taught me some basic concepts of programming that did make it easier to move on to more advanced languages. I would recommend it to anyone who wants to get started.

 

What are your Small Basic projects right now?

At the moment, I have few Small Basic projects. While I could use the language if I needed to, I seldom program in it.

Current Small Basic projects would be the extension I wrote at the start of October (I still need to update that), and the extension manager I proposed to the community. The latter of which is in a prototype state, but I have put it on hold due to a lack of interest by extension developers.

 

What is Small Basic for? Who is it for?

Small Basic, as you would expect, is a rather basic language. However, this should not discourage those who are looking into it. In my opinion, it is a great tool for teaching the basics of programming.

It is simple enough for almost anyone to understand, while allowing for a fairly powerful application if you really get into it. As well as this, it is also one of the few learning-oriented languages I have seen to include the capability for both command-line and GUI-based programs.

 

What are your top 3 favorite Small Basic extensions?

The extensions that I would consider my favourites would be the following, in descending order: Oskariok's Data Extension, it is a great extension providing a lot more functionality; LitDev's extensions, as they provide a lot of functionality as well as full source code, which will be a great learning aid to those who wish to develop extensions; and Gungan37's Joystick/Game Controllers extension, as it provides functionality to further improve the games created by the Small Basic community.

 

What can people do to help get Small Basic into educational systems?

Speak to your teachers.

I know it may be a daunting prospect, to suggest what teachers should be teaching, but if you present yourself correctly, you should be fine. In my experience, teachers will be interested in what you have to say, and you should speak to the head of that department in your school.

If you are not in a high school, but in a Primary school, you should speak to the management team.

Ask either the department head or the management team if you can speak to them about an idea, prepare a presentation if you wish, and just tell them what Small Basic is, and why you think it would be an improvement over what they are teaching at the current time.

However, be careful how you word your speech. You shouldn't outright insult the teachers or their course, rather you should provide evidence as to why it is not as good. Here's an example: rather than "The current course is stupid, and old", you could say "The current course does not provide a steady ease into programming that many students would deal better with, and the language being taught, while perfectly fine as an example, does not introduce modern concepts to the students."

Take care to do your research, however, as the language they are teaching may not be that old.

- Liam

 

=======================

 

Thank you to Liam!

Ask Liam any more questions in the comments below.

And let me know who I should interview next!

   - Tall Basic Ed

Why Learn Small Basic?

$
0
0

Today, we have a special guest blogger, Philip Conrod! He is sharing with us an excerpt from their book for kids, Beginning Microsoft Small Basic by Philip Conrod and Lou Tylee. This section is available as part of Chapter 1 of "Beginning Microsoft Small Basic". You can find their books and other materials at the Computer Science For Kids web site. Thanks to Philip for sharing. Please enjoy!

 

==================

 

We could very well just ask the question – Why Learn a Programming Language? A programming language is used to provide instructions to a computer to do specific tasks. There are several reasons for doing this. First, if you know how to program, you will have a better understanding of just how computers work. Second, writing programs is good exercise for your thinking skills – you must be a very logical thinker to write computer programs. You must also be something of a perfectionist – computers are not that smart and require exact, perfect instructions to do their jobs. Third, computer programmers are in demand and you can make a good living. And, last, writing computer programs is fun. It’s rewarding to see your ideas for a certain computer program come to life on the computer screen.

So, why learn Small Basic? One big reason is that it’s free from Microsoft. Another reason for learning Small Basic is that it is one of the easiest languages to learn. Small Basic is a simple language. There are many built-in elements that make your work simpler and the language itself is very simple – only 15 reserved keywords. But, just because it is a simple language doesn’t mean it lacks capabilities. You will see throughout these notes that you can build some fairly complex programs.

Because of its simplicity, you can learn to write Small Basic programs very quickly. But, just because you can write your first program quickly doesn’t mean you’ll learn everything there is to know about Small Basic. This course just introduces Small Basic. There’s still a lot to learn – there’s always a lot to learn. So, consider this course as a first step in a journey to becoming a proficient computer programmer.

And, once you’ve mastered Small Basic, you can graduate to its more capable big brother VisualBasic, another Microsoft product used to develop GUI (graphical user interface) based applications. These are applications with menus, toolbars, buttons, scroll bars, and other controls which depend on the computer mouse for input. Examples of GUI applications you may have used are word processors, spreadsheet programs and computer games.

 

==========

 

Excerpt © Copyright 2012 By Kidware Software LLC  All Rights Reserved.  Philip Conrod & Lou Tylee have co-authored dozens of books and tutorials for beginning Microsoft Basic, Small Basic, Visual Basic,  and Visual C# developers of all ages for over 25 years.

Windows Forms I/O Extension for Small Basic

$
0
0

New Version 2.0 - Please download it here as part of the larger I/O Extension: http://ioextension.codeplex.com/

New features/changes to the Web Forms in version 2.0:

  • Chart control
  • Changed the class's name to "Forms" instead of "WindowsFormsForSmallBasic". There is an updated sample with ID: ZQX928.

 

The information is provided by the Extension creator, Gungan 37...

====================

 

Hello guys! I have spent the past couple of days writing a new extension for Small Basic. Here is a screenshot of a program made with it:

 

The extension adds the following Windows Forms controls to Small Basic (** means that no other extension supports the control):

  • Button
  • RadioButton
  • CheckBox
  • Chart
  • Label
  • LinkLabel
  • NumericUpDown
  • DateTimePicker
  • MonthCalendar
  • ProgressBar
  • TrackBar
  • RichTextBox
  • PictureBox
  • MaskedTextBox
  • NotificationIcon
  • ComboBox
  • TreeView
  • ListView

 

Plus, it is 100% event driven! It is super easy to use! Just call WindowsFormsForSmallBasic.Setup() before you start and WindowsFormsForSmallBasic.InitializeForm() when all the controls are placed--- this shows the form and hands off control to it. You may not modify the controls after this or write any more code outside of the event handlers. However, your event handlers can preform these operations.

Here is a sample (outdated, for v1): HMD046

And download link for the extension (outdated, for v1): http://www.mediafire.com/download.php?b8w679cqs6mpusr

Please ask any questions you make have and suggestions / bug reports in this forum thread.

=================

 

Thank you to Gungan 37 by providing this extension to the Small Basic community! We'll dig deeper on the I/O Extension in later blog posts!

 

   - Tall Basic Ed

Who should we interview next for the Small Basic blog?

$
0
0

Our first interview was with Liam McSherry. Please go check it out!

 

So who do you think we should interview from the Small Basic community? Also, what questions should we ask them?

Respond in the comments below with as many people and questions as you want. 

 

I'll update the blog post with a list of who you think we should interview and what questions you think we should ask (for a specific person or general questions).

List of suggestions from the related Forum thread and from the comments below:

 

Thanks!

  - Tall Basic Ed

Small Basic Interview - Philip Conrod (Visual Basic, Assembler, Pascal, Fortran, COBOL, Java, Visual C#, & Small Basic)

$
0
0

Today I am interviewing Philip Conrod.  

Philip has co-authored, edited and published several Microsoft Small Basic programming books and tutorials with his friend and colleague, Lou Tylee. 

Some of these books include the following Small Basic Best Sellers:

    

Let's get started!

Who are you, where are you, and what do you do? What programming languages do you use?

My name is Philip Conrod and I live in Maple Valley, Washington USA.  I serve as the Publisher & President of Kidware Software LLC and I also serve as the Chief Information Officer for a large manufacturing company is Seattle, Washington.  Over the years  I have co-authored, edited and/or published numerous computer programming tutorials and books for kids, teens and adults.   My co-author, Lou Tylee, is actually the creative force behind most of the Kidware Software programming tutorials.  Lou taught Microsoft Visual Basic at the University of Washington for over 15 years and he really knows how to teach programming in a fun and friendly way.  Lou started programming in 1969.

I have personally written applications in BASIC, Assembler, Pascal, C, Fortran, COBOL, RPG, JCL, Java, Visual Basic, Visual C# and most recently Small Basic.  

Tell us about your history with Small Basic. How did you learn about it? What has your experience been?

I accidentally ran into Small Basic when Vijaye Raji was showing it off in  Microsoft DevLabs back in late 2009 and early 2010.  Small Basic  caught my attention as it reminded me how fun Microsoft Basic was to learn when I was kid back  in the late 1970s.  I started out on the Commodore PET, Apple II, and the TRS-80 line of microcomputers.  I fell in love with computer programming at a very young age and BASIC was actually my first love.  Don't tell my first girlfriend that!   

After developing programs in  Small Basic for several weeks, I contacted Vijaye Raji  and told him that Lou and I were writing several Microsoft Small Basic programming tutorials.  I asked Vijaye if he would be willing to review the tutorials to make sure we didn't miss anything important in Small Basic.  Vijaye graciously agreed to this and we ended up publishing half a dozen books for Microsoft Small Basic.  During that process, Microsoft Press also gave us special permission to re-publish one of their classic David Ahl BASIC programming books, using Small Basic, so a whole new generation of Small Basic developers could enjoy it.  Microsoft also licensed some of our Small Basic material for the Microsoft Small Basic 1.0 MSDN website launch.  It has definitely been a lot of fun working with all the different Microsoft employees and the different teams that support Small Basic  inside the Microsoft Corporation.

By the way, you can check out most of these Microsoft Small Basic programming books and tutorials on our ComputerScienceForKids.com website.

What are your Small Basic projects right now? What else are you working on?

We are about to publish "Small Basic For Kids" in a paperback textbook format.  It is targeted to elementry students (8 years and up) and middle-school students. It  is based on a original best-selling BASIC programming books for kids by Edward H. Carlson.

Kidware Software also  publishes beginning programming titles for other Microsoft Integrated Development Environments like Visual Basic Express and Visual C# Express.    When you click on the "graduate" button within Small Basic to convert your programs to Microsoft Visual Basic, you may want to check out our beginning programming tutorials for Visual Basic or even Visual C#. 

 

What is Small Basic for? Who is it for?

I think it is great tool for teaching programming to kids, teens and even beginning adults.   It is simple enough for kids to understand and powerful enough for beginning adult programmers to have a lot of fun.  It is a great way to introduce programming to beginning students.

What can people do to help get Small Basic into educational systems?

I personally volunteer and teach programming to students at local middle school and high schools around the Seattle area. I also talk to students about why they may want to pursue a lucrative career in computer programming. 

I personally like to use Microsoft Small Basic to show the students how easy it is to develop their very own game in just one class period.  Kids and teens love to play video games so why not use the power and simplicity of Small Basic to teach them how to write their very own video games.  Kids and teens get immediate gratification within  20 minutes of working with Small Basic.  I love seeing that "aha" moment when a student gets their Small Basic Turtle to zip around the computer screen for the very first time. 

I should note that many of our Small Basic Programming Tutorials are self-study and a lot of teachers around the the world who use our programming books for teaching programming for the first time are only a couple of chapters ahead of their students when they are teaching their first programming class.  Small Basic is just that easy to learn and teach.

 

By the way Ed, thanks for helping facilitate the Microsoft Small Basic forums (in addition to your day job).    You are a welcome addition the the Small Basic community of developers, teachers, and programming enthusiasts!

=================

You're welcome Phil! And thank you for this interview and for helping us get Small Basic out to the world of future game and software developers!

   - Tall Basic Ed


Small Basic for Little Kids Series #01 – A Typing Game

$
0
0

 It’s always fun to teach the little ones to learn and do something.

Teaching programming is no different.  As previously mentioned, I have been on the lookout for a fun and low-barrier language for beginners, a third grader to be exact.

So far, all in all, I’ve spent about 20-30 hours with my son on getting used to the idea of Small Basic.

He is proficiently familiar with operating a computer, playing some games, including MineCraft (yeah, it’s Java based I know.  Trying to explain heap size to him was no fun…)

Anyway, we were on vacation recently and he got really bored with swimming and sand digging, and decided to write a game himself.  So, that’s what we have here.

I had to explain the concept of array to him, and didn't exactly remember how I learned array when I was a kid or how others normally do.  So, after struggling for like five minutes, I finally came up with the analogy of showing him a picture of a string bean. 
The string bean itself is an array, and all the beans inside are the element.  Truth be told, I am not sure the analogy really helped.  But between the picture and my three or four attempts are explaining this, he finally got it.  Not completely, but enough to get going.

After that, he pretty much did all that by himself – I think in less than one hour while my wife and I were dozing off.  Too much sun does make you sleepy :)

For those of you just started to learn programming and MS Small Basic in particular, I will run through the code briefly, since there wasn’t much (any!) comments in the code.

The last program he wrote (which I will get to in the next installment of the series), he had a lot of comments – more than I see for some programmers code.

But this time around, he was in a big hurry to get the game working, and told me he would add the comments later when he is done.  Of course, the vacation was over, his interest (for the moment) moved onto something else.  And we left with a piece of code with no comment whatsoever.  Sounds familiar, no?   On the bright side, I am sure he is not doing it for job security :)

Anyway, I digress.  So, let me get back to the code.

These two lines below set up the Graphics Window with a defined width and height.   Straightforward enough.

GraphicsWindow.Width = 500

GraphicsWindow.Height = 400 

 

The next three lines set up three controls:  2 Text Boxes and 1 Button.  Don’t overlook those three lines.  There are actually a lot to it.         

tbShow = Controls.AddTextBox(170,110)

tbType = Controls.AddTextBox(170,200)

bNext = Controls.AddButton("next",350,200)

 

  • Variable name convention.  In the past I showed him how to prefix all TextBox controls with ‘tb’.  I don’t think he quite understand the concept of camel case, but somehow he stuck with the ‘tb’ convention.  That’s the thing with kids.  Sometimes they are willing to do/try things without fully understanding/accepting the rationale behind it.  Further, he improvised by using ‘b’ for button.  I personally use ‘btn’ (dropping the vowel).  He must have decided that the proper way to do it is to use the first letter of the control.  Interesting.
  • Lack of Label control.  Of course, if one graduates to full VB (Visual Basic), the full array of controls (including Label) will be available.  So, he has to make do with Text Box instead.
  • Positioning of the controls.   This he told me he had to try a few times until he felt he got it right.

 

The next 26 lines are pretty interesting.

letter[1] = "a"

letter[2] = "b"

letter[26] = "z"

 

I am still waiting for a proper moment to tell him about the character function, or Text.GetCharacterCode and Text.GetCharacter functions in the case of SB, and ASCII code, and all that.

But if you are in a hurry, you can give it a try yourself.

These two lines of code will give you the idea of getting the ASCII code for a letter, and displaying a letter (character) based on the ASCII code.

TextWindow.WriteLine("ASCII
code for 'a' is: " + Text.GetCharacterCode("a"))

TextWindow.WriteLine(Text.GetCharacter(97))

 

Here is the output on the TextWindow console.

ASCII code for 'a' is: 97

a

 

Moving on to the rest of the code.

He decided to declare two variables.

a = "0"

b = "0"

 

This alarms me.  I am not entirely sure where he picked up the bad habit of using one letter meaningless variable names.  I don’t think it’s from me :)

I am going to do more observations on this, to partially fulfill my quest to understand whether a bad programmer was born that way, or taught that way …

Regardless, he decided that one of the variable is used to keep track (counts) of the 10 questions, while the other one is used to track the correctly typed ones.

n = Math.GetRandomNumber(26)

 

This line picks a random number between 1-26, and assigns it to n.

For functions like this in any programming language, one thing to watch out for is the lower and upper bounds, e.g., does it start from 0 or 1?  Does it end with 26 (inclusive or not)?  This constitutes a more-than-you-think number of errors.

 

The next line display the letter in the textbox, by setting the display text for that textbox.

Note the reference to the array element letter[n].

 

Controls.SetTextBoxText(tbShow,letter[n])

 

The next line associated the subroutine ‘subButtonClicked’ with the button click event handling.

Controls.ButtonClicked = subButtonClicked

 

It is a bit different from the “usual” way of doing it in that the event handling is at button clicked level.  Then within the subroutine ‘subButtonClicked’, it’s further checked which button is clicked by

btnClicked = Controls.LastClickedButton

 

So, hopefully, now you get the idea of the flow of the program.  I will probably have done it differently to make code tighter.  But I guess it’s good enough for a little kid :)

 

I will leave the rest of the code for you read through at your own place.  Please feel free to comment here if you have any questions.

 

Here is the complete code:

 

The indention might be a bit off due to copy-and-paste... 

 

GraphicsWindow.Width = 500

GraphicsWindow.Height = 400

 

tbShow = Controls.AddTextBox(170,110)

tbType = Controls.AddTextBox(170,200)

bNext = Controls.AddButton("next",350,200)

 

letter[1] = "a"

letter[2] = "b"

letter[3] = "c"

letter[4] = "d"

letter[5] = "e"

letter[6] = "f"

letter[7] = "g"

letter[8] = "h"

letter[9] = "i"

letter[10] = "j"

letter[11] = "k"

letter[12] = "l"

letter[13] = "m"

letter[14] = "n"

letter[15] = "o"

letter[16] = "p"

letter[17] = "q"

letter[18] = "r"

letter[19] = "s"

letter[20] = "t"

letter[21] = "u"

letter[22] = "v"

letter[23] = "w"

letter[24] = "x"

letter[25] = "y"

letter[26] = "z"

a = "0"

b = "0"

n = Math.GetRandomNumber(26)

 

Controls.SetTextBoxText(tbShow,letter[n])

 

Controls.ButtonClicked = subButtonClicked

 

Sub subButtonClicked

 
  btnClicked = Controls.LastClickedButton

 
  If (Controls.GetTextBoxText(tbType) = letter[n]) Then

    n = Math.GetRandomNumber(26)

    Controls.SetTextBoxText(tbShow,letter[n])

    a = a + 1

    b = b + 1

    Controls.SetTextBoxText(tbType,"")

    Else

    a = a + 1

    n = Math.GetRandomNumber(26)

    Controls.SetTextBoxText(tbShow,letter[n])

    Controls.SetTextBoxText(tbType,"")

  EndIf

  If (a = 10) Then

 
    Controls.HideControl(tbShow)

  
    Controls.HideControl(tbType)

  
    Controls.HideControl(bNext)

  
    scoredisplay = Controls.AddTextBox(170,160)

  
    score = Controls.AddTextBox(170,200)

  
    Controls.SetTextBoxText(scoredisplay,"           \/ score \/")

  
    Controls.SetTextBoxText(score,b + " out of " + a)

  
    brestart = Controls.AddButton("restart",310,300)

  EndIf

  If (brestart = Controls.LastClickedButton) Then

 
    a = 0

  
    b = 0

  
    Controls.HideControl(scoredisplay)

  
    Controls.HideControl(score)

  
    Controls.HideControl(brestart)

  
    Controls.ShowControl(tbShow)

  
    Controls.ShowControl(tbType)

  
    Controls.ShowControl(bNext)

  
    n = Math.GetRandomNumber(26)

    Controls.SetTextBoxText(tbShow,letter[n])

  EndIf

 EndSub

 

 

Color Memory Game - Today's Featured Small Basic Program

Microsoft's History with BASIC (Altair 8800, TRS-80 Color Computer)

$
0
0

A Brief History of Small Basic

Today, we have a guest blogger, Philip Conrod! He is sharing with us an excerpt from their book for kids, Beginning Microsoft Small Basic by Philip Conrod and Lou Tylee. This section is available as part of Chapter 1 of "Beginning Microsoft Small Basic". You can find their books and other materials at the Computer Science For Kids web site. Thanks to Philip for sharing. Please enjoy!

 

==================

... First I thought it would be interesting for you to see just where the Small Basic language fits in the history of some other computer languages and, in particular, with Microsoft products. 

Most programming in the early days of programming was done in such cryptic languages by engineers and mathematicians. Two professors at Dartmouth College wanted to explain programming to “normal” people and developed the BASIC (Beginner’s All-Purpose Symbolic Code) language to help in that endeavor. BASIC was meant to be a simple language with just a few keywords to allow a little math and a little printing.

In the later 1960’s, timeshare computing, where a user could sit at a terminal and interact with the computer, became popular. The primary language used in these interactive sessions was BASIC. The Dartmouth BASIC was not sufficient for the many applications being developed, so many extensions and improvements were made in the BASIC language. Many of the first computer games were written on timeshare terminals using BASIC. The first complete game I wrote was on an HP-1000 Timeshare Basic system using a TTY-33 Terminal. Here is one such terminal:

HP-1000 Timeshare Basic system

These terminals allowed direct interaction with a mini or mainframe computer. Your computer output was on paper and programs could be saved on a punched paper tape.

In the summer of 1969, Bill Gates and Paul Allen began writing BASIC programs at Lakeside High School in Seattle using this same kind of teletype terminal. Bill continued programming and started little business ventures until January 1975 when this magazine appeared on the stands:

magazine

On the cover is an Altair 8800 computer. It must have been really expensive – note the ‘Save Over $1000’ line. About all the computer could do was flash some lights according to a program written by the user. But, it was the first home computer. Bill Gates and Paul Allen saw the potential. They developed a BASIC language for the Altair computer and marketed it through their new company – Microsoft. Yes, the first product sold by Microsoft was the BASIC computer language. It sold for $350 and was distributed on a cassette tape.

Then, in the late 1970’s and early 1980’s, it seems there were computers everywhere with names like Radio Shack TRS-80, Commodore 64, Texas Instruments 99/4A, Atari 400, Coleco Adam, Timex Sinclair and the IBM PC-Jr. Stores like Sears, JC Penneys and even K Mart sold computers. One thing all these machines had in common was that they were all programmed in some version of Microsoft’s BASIC. Each computer had its own fans and its own magazines. Computer users would wait each month for the next issue of a magazine with BASIC programs you could type into your computer and try at home. My computer of choice at that time was the TRS-80 Color Computer:

TRS-80 Color Computer

Like Microsoft’s first product, our BIBLEBYTES programs were distributed on audio cassette tapes.

This was a fun and exciting time for the beginning programmer, but the fun times ended with the introduction of the IBM-PC in the early 1980’s. Bigger and faster computers brought forth bigger languages and more complicated  development environments. These new languages were expensive to purchase and difficult for the beginning programmer to grasp.   That brings us to Small Basic, which I would call a close relative of the early, original BASIC language. Small Basic was created by Vijaye Raji, a developer at Microsoft, in 2008 in response to an article written in September 2006 by David Brin called, “Why Johnny can’t code”.  It would be best to let Vijaye tell the story of how Small Basic was born. To read more about the history of Small Basic, see Vijaye’s blog post, dated October 23, 2008, and entitled “Hello World”.

Screenshot

The development of Small Basic was a several-years-long project by Vijaye Raj to rekindle the exciting days when just about anyone could sit down at a computer and write a simple program using the BASIC language. Those of you who wrote programs on those old “toy” computers will recognize the simplicity of the Small Basic language and the ease of its use. And you will also notice Small Basic is a great environment for writing and testing code, something missing in the early 1980’s. ... For those of you new to programming, I hope you can feel the excitement we old timers once had. For the old timers, I hope you rekindle your programming skills with this new product.

==========

 

Excerpt © Copyright 2012 By Kidware Software LLC  All Rights Reserved.  Philip Conrod & Lou Tylee have co-authored dozens of books and tutorials for beginning Microsoft Basic, Small Basic, Visual Basic,  and Visual C# developers of all ages for over 25 years.

 

Small Basic Code Block Generator: How to format a Code Block

$
0
0

Today's guest blogger is Nonki Takahashi. You can find the latest version of this article here on TechNet Wiki.

Nonki Takahashi's avatar

 

This article is especially for the Small Basic article writer on TechNet Wiki.  It explains the Code Block Generator v1.3
 
There is a menu icon of [Format Code Block] to generate code block in TechNet Wiki [EDIT] menu bar.




This [Format Code Block] tool shows following popup window.  But there is no option to select Small Basic programming language.



 So, we need another tool to generate a Small Basic code block.  The Small Basic program ID SKC235-1 is a tool for that.



Usage of this tool is almost the same as as the TechNet Wiki's [Format Code Block].  If you click the [OK] button, you will see the following window.



And copy this code block and paste with [PasteHTML] button into TechNet Wiki [EDIT] screen.  Then you get the following code block:

' Sample Program
For i = 1 To 10
  TextWindow.Write(i + " ")
EndFor
TextWindow.WriteLine("")

 


See Also

Other Languages

 

You can find the most up-to-date version of this article here on TechNet Wiki.

Thanks to Nonki for this great article and for making the "Small Basic Code Block Generator" program! Nonki also provided the Japanese version of this article!

   - Tall Basic Ed

 

Small Basic TeamChallenge - Tower Defense Game (VOTE TO SEE WHO WINS!!!)

$
0
0

Small Basic community member Timo Sö had a winning idea: to start a TeamChallenge competition. The challenge was to create a "Tower Defense Game" in one week. They developed their games from 12/3/2010 to 12/10/2010. Here is Timo's first Forum thread on the topic.

Here are the teams:

 

1. Tank Rampage Team:  Math Man, Timo Sö, (3rd person dropped out)

Find the code hereDownload the .RAR file

Math Man did 99% of the code. Timo created the graphics and did some small bug fixes.

 

2. Tankinator Team:  Zock77, Cobra55, (3rd person dropped out)

Find the code here | Download the .RAR file

The game cannot be played in the gallery list. You must download it and play it locally.

Zock did 100% of the coding. Cobra helped make the graphics.

To make the graphics, they used Gimp. They made the corners transparent: http://www.wikihow.com/Make-a-Transparent-Image-Using-Gimp

   

Ready to vote for your favorite game?

Vote Here

On that forum thread, reply with your input on which game you think is the best! The score is currently 4 to 0!

Thanks to all five of the TeamChallenge members! We'll definitely see more of these in the future (Timo and Zock are already planning one for January)! You can track all the action in the Small Basic forum. I'll make the current TeamChallenge threads sticky.

 

What's your high score? Comment your answer below!

   - Tall Basic Ed

Small Basic - The Happy Number Challenge

Tanks Game - Small Basic Featured Program

$
0
0

Today's game comes from Behnam Azizi.

Here's a screenshot of Tanks Game:

Download Tank Game from TechNet Gallery

And be sure to rate the game too!

Instructions:

  1. At the beginning, each player places their tanks anywhere on theri own land (lands are seperated with the red line).
  2. Then starting with the top player you click somewhere in your own land. Once you click there, the corresponding point on the other side of the red line willl be shot. If the enemy's tank is there, then the tank will explode. If it's a miss, you'll hear an "error" sound.
  3. If you hear no sound, then it's likely the other person's turn, and you need to click on the other side of the red line.

Although this game is optimal for two players, it's also fun with one player firing on both sides! You can decide which of your personalities should win. =^)

I added "Tanks Game" to the Program Gallery. The source code for Tanks Game is available in this Small Basic forum thread.

Have you played the game? Leave a comment with your thoughts!

   - Tall Basic Ed


Christmas Trees - Small Basic Featured Programs

$
0
0

As part of LitDev's December Challenges, Nonki suggested this Christmas Tree challenge:

"Draw a Christmas tree - how about with flashing lights."

First here's NaochanON's version:

Watch the program here.

Just when you think nothing's going to happen, something does! =^)

 

And now here's Nonki's version:

Screen shot of a program Xmas Tree

Watch the program here.

Nonki recommends that you run it locally. Um, and if you keep watching, something interesting rolls by the screen. =^)

 

What do you like about them? Leave a comment below!

Merry Christmas everyone! Oh, and Happy Holidays to boot!

   - Tall Basic Ed 

 

Small Basic Interview - LitDev, Scottish MCC & Forum Moderation Ninja (Sinclair Spectrum, Small Basic, Fortran, C++, C#)

$
0
0

Today's Small Basic Interview is with LitDev! I've gotten a lot of requests to interview Steve, so here we are! He is a Microsoft Community Contributor (MCC). LitDev is the primary moderator of the Small Basic forums. He hosts the Challenges of the Month. Here's the list of blog posts that have featured his challenges. Here is an example of the monthly challenges: the December Challenge forum thread. LitDev has also pinged me to get more support in moderating the forums, and his efforts ultimately led me to help out in this community.

 LitDev's Profile

Let's get started with the interview...

============

Who are you, where are you, and what do you do? What programming languages do you use?

I am Steve and live in Scotland.  I work in the capital city Edinburgh for a small software company that develops software for the oil and gas industry. 

The program I develop is used to model fluid flow under the ground.  In addition to the flow of water, oil and gas in the rocks and wells, it models the effects of temperature, chemistry and geo-mechanics.  As oil is produced the pressure falls and often water is injected to maintain the pressure.  The injected water will usually be at a lower temperature and have different chemistry and may contain other chemicals like polymers, which together can affect the way the oil is produced.  The work is very varied with lots of different physics, chemistry and mathematics which are my main interests.  Programming is just one of the tools we can use to help understand how different physical processes interact.

Most of the calculations are done using Fortran which is not so different to Small Basic, but good for large mathematical problems where speed is important.  I also use C++ for the interface and some C#.  I have a basic knowledge of other languages, but the principals are much the same; so when you know one, others are easy to use.

I have 3 children and 2 of them are 11 and 12, the perfect age for Small Basic.

 

Tell us about your history with Small Basic. How did you learn about it? What have you learned? How has it helped you grow?

I first came across Small Basic nearly 4 years ago when there was a small advert for it in Visual Studio when it was in fairly early stages of development (Version 0.2 I think) by Vijaye Raji at Microsoft.

I first started programming when I was about 14 using a Sinclair Spectrum computer in the early 1980s and Small Basic immediately reminded me of the fun I had then trying to get the most out of a fairly simple machine and programming language.

I really liked the idea of a proper language that was simple to get started with and could provide the environment for a new generation to experience the fun I had when I was young.  I also saw it as an ideal way to lead new programmers into the larger and more complex languages available today.  Because Small Basic is actually quite slow it requires programmers to create efficient and well-structured programs.  To get the most out of it you need to work quite hard and have a good understanding of how it works; for me this is a plus and reminds me of the challenges of working with early computers.

I got a lot of satisfaction writing small programs with Small Basic and trying to get it to do new things as well as helping new programmers and encouraging their enthusiasm, as well as my own children.  The imagination and dedication of users inspired me to help out as much as I could.

    

What is Small Basic for? Who is it for?

Small Basic is for anyone (young or old) who is just interested in 'how it works'.  I think that there is so much technology that we use every day, and most people have very little idea how it works, and have no idea how much imagination is required and how much satisfaction can come from being creative with computers.

I think it is particularly important that children get the opportunity to learn something about a very important part of how our society works.  Even if they don't become programmers, they should have an opportunity to see how imaginative and fun it can be not just using technology, but knowing how it works.  This includes programming, but also physics and mathematics. 

 

On what Small Basic programs and extensions have you collaborated with other community members? What was that experience like?

I especially like some forum questions where there is a series of questions and replies over a period of time on the same topic.  Sometimes they have been programming questions and sometimes physics type questions.  Trying to understand what someone is thinking and trying to explain in different ways how to approach a problem is the most satisfying.  This is especially true when it is a user that has been around for a while and you get to know them a bit, and you can see their skills and knowledge increasing.

  

What are your favorite Small Basic programs?

My favourite programs are those that surprise me.  Sometimes they are just a full working program 'out of the blue' like SokoCute which is probably the most polished program ever written in SmallBasic, or just an imaginative use of some feature.  Recent examples include some of the graphical challenges recently by Nonki Takahashi and NaochanON.

I also like programs that look like they should work but don't with strange or obscure bugs I haven't seen before.  Even more rarely there are programs that look like they shouldn't work but do, I remember one where the Timer Event was used to effectively create a multi-threaded parallel program for sorting numbers!

Basically I like little puzzles and the Small Basic forum users give me a constant supply of these.

 

What are your favorite Small Basic extensions?

My favourite extension is the Fremy extension.  There is so much interesting stuff in it.  Originally it was open source and gave a lot of insight into how Small Basic could be interacted with in interesting ways.  Its methods are quite advanced and not so well documented, but there are so many possibilities opened by it.

Recently there has also been a crop of new extensions which show that people are thinking beyond Small Basic which I think is important.  I see Small Basic as just the starting point or 'stepping-stone' to experimenting with other languages which could be too intimidating and hard to start without first getting the basics with Small Basic.

   

Who has impressed you in the Small Basic community, and why?

Over the years several programmers have impressed with their imagination and it is satisfying to see them develop and move on.  I am particularly impressed by some of the younger developers - there have been many, but the current crop of 10-13 year olds is exceptional. 

Also the Small Basic community is very interactive and most help answer and show their projects as well as asking questions.

 

What can people do to help get Small Basic into educational systems?

The main problem is that teachers don't know about it, so let them know.  Learn a little and show them what you have done.

Most schools seem to use Scratch and Kodu.  While these are fine programs, for me they try to get children's attention by very rapid development of pretty graphics by fitting bits of a jig-saw together.  When I started programming it was the ability to create something out of nothing and understand how the whole thing worked that I enjoyed.  It isn't really the end product, but the process of using imagination and developing skills to do it that is really where the fun is.  Small Basic captures this aspect perfectly.

One last thought, girls don't seem to be as attracted to programming as boys, so perhaps there is more that could be done here - maybe interview a female next time. 

=============

 

Please ask LitDev any additional questions in the comments below!

Thanks!

   - Tall Basic Ed

 

Block Smasher - Small Basic Featured Program

$
0
0

Today's post is a combination of a guest blog and a featured program! It comes from Behnam Azizi. In Behnam's words...

Here is the new version of my old game I used to call "Breaker". Since It had the same name as my previous game it didn't catch the eyes. I changed the name to a more unique one. It's the best game that I have made with small basic so far. Here are the descriptions: 

Block Smasher V 2.0 Ultimate

Finally, the ultimate version of the Block Smasher game is out! download it from here and play. It has 6 distinct levels and I also added save/load features and cheat codes to the game for more fun. You will get the cheat codes once you finish the game (And please don't cheat to find the cheat codes! Play the game thoroughly!). Follow this link to download: Block Smasher V2.0 Ultimate on Microsoft Technet Gallery

And I downloaded the sound used in the main menu from here:

Garden party.mp3

Also if you are looking for the source code find it in my previous post here: Source code of Block Smasher.

================= 

 

Thanks to Behnam for these great experiments with a Breaker game!

   - Ninja Ed

LED Display - Small Basic Featured Program

$
0
0

Today's featured program is the LED Display from Amir CPS. Thanks to LitDev for nominating the program here.

The Forum thread that explains this program (and gives you the code):

http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/3cf9385b-fdb0-4f42-9436-21d95e778903#b617a188-4fb0-40ea-b64e-135113640f9a

Modify it to show your own message!

Modified version: ZRL837

 
An earlier version:
 

 
Thanks to Amir for writing this great program! It was a school project.
 
Have you used it? What do you think? Leave a comment!
 
   - Ninja Ed
 

Small Basic for Little Kids Series #02 – Loop

$
0
0

The single most important concept in programming is loop, I think.  And yet, it's (usually) not an easy concept for kids to grasp. I remember when I was young, I had to struggle with the idea of loop and N=N+1.

Back then, a loop in BASIC might look like this:

10 PRINT "123"
20 GOTO 10

GOTO statement had and continues to have the reputation of producing spaghetti code.  However, based on my estimation, it does make it much easier to explain the loop :)

Of course, the two-line code above will go into infinite loop and the only way to stop it is by forcing stop execution of the program, e.g., by hitting Ctrl-C.

So, how to make 10 loops?  Here is one way to do it.

10 N=1
20 PRINT N
40 IF N>=10 THEN END
30 N=N+1
50 GOTO 20

Another way is to use the FOR-NEXT construct.  I think it goes something like this:

10 FOR I = 1 TO 10
20 PRINT I
30 NEXT I

But that's the old syntax.  I am certainly dating myself here.
A couple of things you will notice though.
One is the presence of line numbers.
Another is the capitalization of all code.

With MS Small Basic, the code will look like this:

For i = 1 To 10
  TextWindow.WriteLine(i)
EndFor

Here is the output:

1
2
3
4
5
6
7
8
9
10
Press any key to continue...

In most programming language, white spaces (hence indentation) is insignificant  (with Python being a notable exception)
Therefore, for good programming practice, it's important to indent text appropriately.

For example, with the TextWindow.WriteLine(i) being indented here, it is much easier to see that it's a FOR block.

That being said, it's still not a walk in the park to explain this to my son.

You would be surprised at how kids learn things.  They learn things they want to learn, the way they want, when they want!

I spent about 20 minutes each on two different occassions explaining loop to him.  I thought he got it.  He appeared to understand it.  But when asked a day later, he is like "I don't know."

It stayed this way until over the holiday weeks when he finally got it.  It was so intersting how it happened that I simply have to share it.

He was playing Minecraft (one of his favorite games for now), and was very excited to explain to me how he figured out a way to "trick" the game.

Since I don't play Minecraft, I am not sure if I can explain this well, but will try.  For some reason, he needed to change the time in the game (turning from night to day, or vice versa) by activating a switch or something like that.

The idea he came up with was to construct a circular track and then made the truck to go around and around. Every time it gets to a specific spot on the track, something will be triggered which will then change the time and what not.

Upon hearing this, I seized the opportunity to explain to him that is in fact a LOOP, an infinite loop that is.

The circular track is the loop itself.  The action that's triggered each time the truck go through a specific spot is the content within the loop.

He thought about it and exclaimed he got it.  I do think he really got it this time :)

So the moral of the story is that one doesn't have to sit in front of Visual Studio (or Kid Studio) all day long to learn programming.  Learning happens all the time and in mysterious ways, and especially so for little kids.

Lastly, here is something for a little fun:

For i = 1 To 100000
  TextWindow.Write("123")
EndFor

Can you explain the animation effect of numbers moving?

If you don't get it right away, try this for comparison:

For i = 1 To 100000
  TextWindow.Write("1234")
EndFor

 

Can you see why printing "123" and "1234" produce different effects on your eyes?

Here is a hint.

Usually, the width of the text console is an even number.  The length of "123" string is an odd number.

 

Viewing all 669 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>