# Teaching Small Basic

• ### General discussion

• As recommended by community members, this is a sticky thread to discuss how Small Basic is used for teaching programming.

Please discuss approaches that worked/failed, tools at your disposal, and/or just general ideas to make teaching effective
Monday, March 2, 2009 9:21 PM

### All replies

• To get things started, I'm reposting the dilemma I described in the thread suggesting this sticky:

Next to complexity of programming languages (which SB addresses), coming up with interesting projects is the hardest part of teaching programming to middle and high schoolers. I am aware of resources such as the Euler Project, but all of the ones that I have encountered assume that the user already knows the basics of programming (using variables,  accepting input, managing conditions (If's), processing loops (while's), and using procedures.

Here is an example: I am teaching the idea of using variables to store the results of calculations, and getting the students used to using the Math object. So far, the most exciting project idea I have been able to come up with is calculating the hypotenuse of a triangle.

Given the limited vocabulary of Variables, Reading and Writing text, Turtle commands, and the Math object (which includes random numbers); can anyone suggest a more entertaining or game like project for my newbies?

Tuesday, March 3, 2009 12:08 AM
•

Small Basic project list (so far)

1.      Use Small Basic to write a program that uses the turtle to draw a triangle.  Each side of the triangle will be the side of a square, pentagon and hexagon.

They used brute force the first time.  I then taught the For loop.  They redid the assignment.

2.      Use Small Basic to write a program that will draw regular polygons.  The input will be the number of sides.  The output will be the drawn shape.

Used what they learned in #1 and added the input module.

3.      Write the Small Basic program that draws it.  Your program should consist of two or three subroutines, one for each shape.  If you are not sure how to call a subroutine look at the sub statement in the pamphlet.  Each subroutine should consist of a very simple For statement to draw the sub shapes (square, hexagon).  Do not forget documentation with your name and comments.

(Tesselation graphic will not paste here.)

Fairly easy for some.  The two odd squares make it a little more than just a bunch or For statements.

4.      Write a program to generate the first n terms of the Fibonacci sequence. (very easy for the kids)

5.      Write a program that finds the real roots of a quadratic equation.  The program will request the coefficients a (test that a is not = 0), b and c.  Caution: there are 2 or 1 or 0 solutions depending if the value of  is positive, zero or negative.  Use an ElseIf statement to handle one of the solution options.

Lots of board work required to develop the computer module.

6.      Write a program that finds the real roots of a quadratic equation.  The program will request the coefficients a (test that a is not = 0), b and c.  Caution: there are 2 or 1 or 0 solutions depending if the value of  is positive, zero or negative.  The program will not quit until a “0” is typed for the coefficient a.  At that time the program will explain that “a” cannot be a “0” and ask the user if they want to quit or continue.

Start this next week.  Just incorporates a While loop.

Gets a bit fuzzy after this.  I think I am going to go back to the turtle, the kids seem to enjoy it and it reinforces the use of the For and Sub.  Tessellations are always good projects.  Math related things are always bad projects (according to the kids).

I think I am going to look at having them develop a pong game similar to the one in the Introducing Small Basic document.  Maybe a two player version.

Tuesday, March 3, 2009 4:20 PM
•

http://mathworld.wolfram.com/Tessellation.html

For good tessellation projects.  It is possible to get three assignments of different levels of difficulty off this one page.

Here is my grading rubric.  Notice I do not stress if it works or not.  Getting something turned in does not help a lot.  A 50% is a failing grade so they still need a bunch of the five point items.  I deliberately try to spread the grade weight out so they do all the rubric items.  If some one has something better that will not kill my not-so-sharp kids I am looking.

50 pts Possible

5 pts - On time.

5 pts – Document/program header to include name, purpose of program, date due.

5 pts – program works.

5 pts – major events/sub procedures commented.

5 pts – program is in modular form as opposed to one long string of code.

25 pts – something got turned in that almost works.

5 pts extra credit – program is designed around a Main program core with a number of subroutines.

Tuesday, March 3, 2009 5:59 PM
• I just came across this blog, which has a really cool video presentation for teaching Small Basic.  I hope it'll be useful for self-taught beginners: http://wotudo.net/blogs/how2/archive/2009/02/16/intro-to-programming-microsoft-small-basic.aspx

Thursday, March 5, 2009 12:00 AM
• I have been gone from steady teaching since summer of '04 so I had fogotten how useful the concept of having the kids do variations of the same assignment several times.  They are finishing their third tessellation project.  They have a firm grasp on how useful a For statement is and how to build a program that consists of a Main with a bunch of subroutines doing the work.  They still have a little difficulty with the idea of "planning before typing" but they are getting there.

Some things that they learned the hard way:

1.  Save then Run - SB crashs drastically and it takes everything with it when it goes.
2.  Do not use the same For index variable throughout the program - weird things can happen.  See 1.
3.  Use a variable for side length.  If the shape is too big it is much easier to change the size once than 47 times.
5.  The kid from Spain is a real good programmer but he sure likes to do it the hard way.
6.  Do not copy off of your neighbor, they are worse at this than you are.
7.  "Hey, look! It works!" with absolute amazement in the voice.  This stuff is not as impossible at it seemed.
8.  How did you do that?  It is in the little book?  Where is my little book?!
Friday, March 6, 2009 12:31 AM
• I am looking for a group analogy to introduce the idea of conditional operations and the if statement. What I want to do is take the students outside and line them up, each pretending to be a line of code in a program.

I then want to go down the line, each student contributing to the solution. When we get down to the last student the solution should be good or bad, based where we started from. A good starting point, a good solution. A questionable starting point, a bad solution. There should be a middle part  that causes a problem with certain starting points.

I then want to designate some of the students in the middle as the if block. Again going down the line, when we get to the if statement, and the starting point is questionable, they can correct the problem. If the starting point is good they can continue on as before. The if block will surround the middle part that is causing the problem, and only do that task when it is needed.

Here is my problem: I can't think of a problem that fits these parameters. I'm sure I could invent something mathematical to fit the bill, but I want the analogy to be as far from math and computers as possible. I want this to be a real world hands on analogy that gives them a good image of how conditional operations take place.

Any suggestions?

Friday, March 13, 2009 6:37 PM
• Nice idea,

A little different, but perhaps you could do a simple bubble sort.

Line the students up and start at the end with the person on the far left, moving to the right.

For each student, if the person on their right is taller than them, then swap places and start again.

If the person on their right is shorter, then move to the next person on their right.

Of couse you could use any characteristic such as alphabetical order etc and try to make the algorithm more efficient.

Saturday, March 14, 2009 11:29 AM
• With my students I have dual problems. First everyone is required to take two semesters of computer science, and as a result 95% of them don't want to be there. The second problem is the international nature of the student body. 75% of the students are from somewhere else and only picked up English within the last year. For my introduction to programming course, I have to take things slow, and I need to ensure that the concepts are internalized.

When I first introduce a topic, I like to unplug. Get the kids away from the computer and out of the world of the compiler and just focus on the concept. Unfortunately, I am a die hard computer geek myself, so at times like this, I draw a blank. What picture do I paint?

This time it is conditional operations, and the If statement. Everyone knows the idea of a decision point, even if they are thinking in Korean or German. What I want to do is show how useful the idea is and how easily it fits into the logic of programming.

The bubble sort is good, but to work, you need a loop. Nested loops in fact, and we are at least two weeks out from looping. What I'm looking for is a straight line idea and for the idea to have nothing to do with numbers.

And while you are at it if you could solve the nations fanatical woes, cure cancer, and travel faster the light, that would be good too. ;-)

Saturday, March 14, 2009 5:52 PM
• I cannot remember if i suggested this site to you before but take a look at http://csunplugged.org/.  lots of really cool computer activities without the computer.  I have translated a bunch of them to Word so I can modify them to suit.  Let me know if you want them and i will email them to you.
Friday, March 20, 2009 4:49 PM
• If you guys have a suggested list of activities for teaching 10-12 year olds (my own in this case) that'd be great.  I figured the overly complicated array object would be last...  BTW I suggest a simple form of multidimensional array's like the good old days, then have your collection object for more sophisticated programmers.  Telling them that this "array" collection object can be used like an array leads to the question "what is a real array" and probably never ending confusion.  I think arrays & collection objects should be completely separate and independently useful, to a beginner and advanced programmer.

Also, don't keep adding features to the language, that's a form of a disease!  If you can make something work with basic pieces, don't implement it as part of this language, too many languages are still called Basic, and they are not in any sense.  Last thing, thanks for coming out with this, I've been waiting well over a decade to see this again.
Monday, April 20, 2009 3:43 PM

Check out my post in the "Programming projects for beginners" thread.  I but my class assignments on Skydrive.  These are for novice sophmores.
Monday, April 20, 2009 4:39 PM

### It needs to be kept simple, be text or turtle graphics based, and no Arrays please. A game idea would be ideal.

Sunday, May 3, 2009 10:49 PM
• I found this a while back. While it deals with Atari Basic, many of the programs and ideas could be adapted for Small Basic

www.atariarchives.org

These items might be of interest to you-

Best of Creative Computing volumes I, II, III
each have a PROGRAMS, PUZZLES, PROBLEMS, AND ACTIVITIES section

BASIC Computer Games
More BASIC Computer Games
Big Computer Games

• Edited by Monday, May 4, 2009 12:04 AM
Monday, May 4, 2009 12:02 AM
• I had copies of those books when I was a kid, they are great. The projects are pretty complex for students who are still thinking 20 line or less, and haven't learned arrays.

My current fall back project will be calculating the cost of purchasing items based on quantity ordered. Run a for loop from 10 to 100 by 10's, multiplying each position by the cost of the item.

I'm hoping for something a little less like a math problem, and more like a game.

Monday, May 4, 2009 1:20 AM
• how to study the small basic???  i have read the book--<Introducing Small Basic.pdf>,but i even can't find how to use the array!! where can i down Comparison is complete "the Reference book" for small basic????
Wednesday, May 6, 2009 8:42 AM
• Here is my latest idea for a class assignment.  Since I have not written the program yet or started teaching the lesson yet I have no idea how it will work out.  Knowing would take all the fun out of it.  The code snippet was lifted from cxeq's button project in the SB forum.

Tic-Tac-Toe

Write a two player tic-tac-toe game.  The program will present the tic-tac-toe grid with boxes where the player symbols are placed.

You will need to find a couple of player symbols (the X and O) from the internet.  It is not necessary to use X and O, just two distinguishing symbols.  For the basic game you will need 9 XO boxes, a “Play again” box and a “Quit” box.  To have the computer determine who has won would be very difficult.  We will save that as a separate project.

Procedures to build:

1.        Draw grid

2.        Draw boxes

3.        Import symbols

4.        Keep track of whose turn it is so the correct symbol is placed in a selected box.

5.        What happens when a box is clicked on

6.        Play again or Quit.

The line of code below imports two symbols into an array named xando.  You will need to put your own file path in the code.

File.GetFiles("C:\Documents and Settings\gflint.MCS\Desktop\Programming\Small Basic\Tictactoe\ symbols ","xando")

The code lines below are a sample snippet of how to create “boxes” for playing the game.

'Startup graphicswindow sequence'

GraphicsWindow.Show()

GraphicsWindow.BackgroundColor = "#8D7374"

GraphicsWindow.BrushColor = "#FF6D7E"

GraphicsWindow.PenColor = "#FF6D7E"

GraphicsWindow.Title = "Educational Game"

GraphicsWindow.Height = "600"

GraphicsWindow.Width = "800"

GraphicsWindow.FontName = "Calibri"

GraphicsWindow.FontSize = 28

'end startup'

'processes and settings

picWidth = 150

picHeight = 150

'creating the pics

picOneX = GraphicsWindow.Width - 780

picOneY = GraphicsWindow.Height – 480

Need one of these for each box.

'drawing the pic

GraphicsWindow.BrushColor = "#FFEDE2"

'pic 1

GraphicsWindow.FillRectangle(picOneX, picOneY, picWidth, picHeight)

GraphicsWindow.DrawRectangle(picOneX, picOneY, picWidth, picHeight)

Need one of these for each box.

GraphicsWindow.MouseDown = handleClick1

'function for handling a click on the pic'

Sub handleClick1

xpos = GraphicsWindow.MouseX

ypos = GraphicsWindow.MouseY

'checks if you clicked inside the pic

'pic one check

If(xpos > picOneX And xpos < (picOneX + picWidth)) and (ypos > picOneY And ypos < (picOneY + picHeight)) Then

GraphicsWindow.ShowMessage("pic 1 pressed", "Pressed")

Need an If for each box.

EndIf

Wednesday, May 6, 2009 2:55 PM
• A very simple Tic-Tac-Toe with lots of possible improvements.

Import XVB145

Learning objectives on this simple program:
1.  If-Then
2.  ElseIf
3.  DrawLine
4.  Create buttons
5.  MouseDown Event
6.  Boolean flags (player = 1)
7.  Modularity

The possibilities for improvements could be "Play Again" button, "Quit" button, not allow an already played square to be played again, import icons for the players instead of colors, computer tracks if the game is won or stalemated, score, and, for those that really know what they are doing, player vs computer.  I would not even know where to start with that one.

Wednesday, May 6, 2009 5:03 PM

• Using Activity Cards as tools for teaching Small Basic: http://smallbasic.com/wiki/Teaching%20Small%20Basic.ashx
Monday, June 8, 2009 7:29 AM
• Hello,

I am trying to teach some fundamentals of programming to my 11 years old daughter. Some experiences to share :

• Giving analogy of variable as a bin which stores something seemed to work better. 'A variable is a bin which stores a value'.
• I am trying to keep away from intricacies of small basic, as far as possible, and trying to focus on the basic programming constructs.  I wish SB would have given the input/output primitives available in basic which are more intuitive then TextWindow.WriteLine. For the time being I told her that if you want to read a number you need to do TextWindow.ReadNumber() etc.
• Teach a few constructs and then solve ample problems using them. For eg. I taught her concept of a number variable, how to set it, WriteLine and for loop and moved to writing some reasonably involving programs which just use these.  I want to make theme as 'how would you solve real porblems using computer language' rather then saying 'let us learn this language'.
• No graphics focus. My view is for a beginner it distract from the aspect of solving real problems using computers and hinders development of intrinsic problem solving ability.
• It works better if she has to modify an existing program. So teacher can create a buggy program and ask students to fix. The bugs could be strategically placed to illustrate a point.
• Here is a small problem which gave her ample ability of practive for loops, if conditions
Please try writing a program for drawing a box.

This program should ask for lenght and widht of the box and then using * characters draw the box.

For example :

What is length ? 5
What is the width ? 3

*****
*     *
*****

What is the length ? 10
What is the width ? 5

**********
*              *
*              *
*              *
**********
The actual program which she finalized is at : http://smallbasic.com/program/?VWG100
Monday, June 29, 2009 10:18 PM
• I have been thinking about documentation for SB for a while.  We have the getting started, API and this forum, but I think we could help new and returning programmers a bit more.  SB has plenty of power with its small syntax set before you hit the limits (mainly performance and structure), by which time you should be set to try something bigger.

I tend to think it is more documentation and structured examples rather than tinkering with the syntax that is important.

I started writing something a while back, but abandoned it because I wasn't happy with it.  I am no teacher and feel too far removed from the questions new programmers ask and how to explain things to them.  However I know there are several teachers among the regular contributors of this forum who must have some resources we can put together in a coherent way.

I like Vijaye's activity cards for children and I feel small examples and projects that progressively show the main features as well as descriptions of the ideas is the way to go.  Especially if it is fun and challenging - the Euler projects was a good idea along these lines, if a little mathematical.  I guess also that different people learn in different ways so contributions from a range of perspectives would be good.

Even though I am not happy with my effort I have uploaded what I started in order to start improving this resource and hopefully we can create something good.

Thursday, July 2, 2009 6:37 PM
• litdev,

I'm glad to see you go in that direction.  I am in complete agreement with you - the success of Small Basic as a teaching aid depends largely on the surrounding documentation and the ecosystem.

Thanks.

Friday, July 3, 2009 6:20 PM
• Its on skydrive, try the link below, the 'Programming guide' an rtf of my first ideas.

http://cid-92f7df0e57232aba.skydrive.live.com/browse.aspx/.Public/SmallBasic/Documentation

Perhaps I'm not getting the link set right, just paste it.
• Edited by Friday, July 3, 2009 7:00 PM
Friday, July 3, 2009 6:49 PM
• Excellent!  The weakest part of SB is the lack of printable documentation.  I did a printable API earlier but just never have time to update it for the new versions.  My next project is to put some kid readable examples with each term in the API.  I taught a semester using SB with good results.  The kids were not programmers or interested in programming, it was the only thing that fit their schedule that semester.  Some got a little out of the course, a couple got a lot.  I definitly prefer SB over VB.net for an intro language.  Less overhead in the IDE and more fun.  The kids would actually play in SB while VB requires too much knowledge to just fiddle around in.
Friday, July 3, 2009 7:08 PM
• I did the printable API by getting interested in XML and then rtf - just learning and playing, there were several perfectly good printable API conversions about so I didn't upload it, but I will upload the executable for the conversion - it is pretty specific to the XML command used in the main SB XML, for example Fremy's doesn't work because he uses other XML tags.  Also I did it with vista so there may be issues running it on XP, I don't know.

If you try it and have problems, post here.

PS it does include the now 'hidden' array commands which is not ideal.

Also, since it writes the rtf in the same directory as the xml, it would need to be run as administrator with the default SB installation directory.  Obviously I wouldn't recommend doing this with downloaded executables (even if you don't think I am malicious, I may be incompetent) so first copy the xml to somewhere you have write access.
• Edited by Saturday, July 4, 2009 8:54 AM
Friday, July 3, 2009 7:18 PM
• See my demo code at:
http://smallbasic.com/program/?CFV877
Friday, September 18, 2009 11:08 PM
• I think the "Introducing Small Basic PDF", printed out and put into a binder, would be age-appropriate for a middle-school or high-school child being introduced to programming for the first time, or any adult who has zero programming experience.

If I was teaching a child, or teenager, I would start with:

1. Hello world.   (Subtly Introduced Concepts: What is a program?  What is "code?" What does "output" mean? What is a computer "language"?)
2. Variables (Subtly introduced concept: State)
I think that the way to get kids interested in variables, is to talk about how easy this would make doing all their math homework.
Who here hates math homework? Me! Me! Me!
Okay (grade 3) kids,  let's do some long-division:
X = 2513/3
(For this, I think immediate mode beats everything else hands down).
3. Decision making (if).
4. Looping (While/For).
5. Built-in functions to make life fun. (Random numbers, turtle graphics, etc)

With those things, I would be aiming for giving the kid capability to do something the kid herself/himself wants to do. (Ask the child.  If they answer "I want to make a video game", help make their wish come true.)

What I wish Small-Basic had, that it doesn't have is immediate mode.   I think for my purposes I would teach a subset of Python rather than small-basic.   With the IDLE ide,
immediate mode and program storage mode are separate.   You can teach kids expressions for example, or to "try something in immediate mode" before they write it in "forever" code.

I wish Small-basic didn't require typing in <SOMEBigLongName>.<SomeBigLongOtherName>.   This is why PRINT is so wonderful.  Why must we burden new developers with the semantic burden of object oriented programming? It is an interesting choice to see Small Basic has no scoping rules at all (all variables are globals, and are untyped variants).
So "intellisense" code-completion reduces the typing overhead, which is good. Maybe it would be great to have a bunch of buttons that the kid can hit, to save them from remembering even the first letter (T for TextWindow, etc) of things they want. Spatial memory being as good as it is in most people, they will remember "that thing I want is the third from the top in the list of buttons", much more easily than they will remember names of things.

I will try teaching my 10 and 12 year old sons with Small Basic, and with Python, and report back my success. The UI of smallbasic is ideal for teaching, except for the lack of an immediate mode.

Warren

wp
Tuesday, October 13, 2009 3:23 PM
• The following worked with my 6th grade class:

Spent a class session writing the directions for making a peanut butter & jelly sandwich:
In class:
-     pretend I am a martian & I have never seen a PB & J sandwich
-     have the students list the directions (& write them on the board)
-     obtain agreement that the diirections are accurate & complete
-     then I make the sandwich according to their directions, following them literally
-     of course there are mistakes & we have to re-write the directions several times
-     it took about an hour
for homework:
-     review the directions, make their own sandwiches & fill in any other gaps
aside:
-     at their break, I let them make their own sandwiches

next session:
in class:
-     we fine-tune the directions
-     discuss the problems of assumptions
-     discuss the fact that computers only do what they're told (they are dumb)
-     play hangman & write directions as we go along (glossing over many items)
-     I put together a high-level flowchart that corresponds to the directions
for homework:
-     review the directions & flowchart, play hangman, and fill in gaps & provide details

next session:
In class:
-     fine tune directions, identify assumptions, identify missing details
-     introduce a programming constructs - simple logic, program flow
-     introduce some of my small basic routines - including my shell of the hangman program
-     show them the intro & API documentation
-     show them some of the out-of-the-box samples
-     let them play

next sessions:
in class:
-     work on the programs (in teams as desired)
-     introduce specific concepts, e.g., arrays

Sunday, October 25, 2009 5:29 AM
• If you are looking for an instructor-led or self-paced Learning or Teaching Small Basic Tutorial, we produce a "Beginning Small Basic Programming Tutorial" which has been  recommended by Vijaye Raji.  It is designed for Middle School and High School students.  Beginning "adult" Small Basic programmers are enjoying this Small Basic programming ebook too as it is self-paced and easy to understand.   The final chapter gives the students examples of how to port the Small Basic games they develop into into other programming languages like Visual Basic, Visual C# and Java.  You can read more about the Beginning Small Basic Programming Tutorial here:

http://computerscienceforkids.com/BeginningSmallBasicComputerGamesPortingTutorial.aspx

We have also successfully ported two classic David H. Ahl programming books to Microsoft Small Basic (with permission of course).  This means you don't have to retype these classic BASIC programming books in by hand and you don't have to figure out how to port the old BASIC programs to Small Basic yourself.

The first David Ahl book we successfully ported to Small Basic  was "David Ahl's Basic Computer Adventures"  which was originally published by Microsoft Press.  All the original classic adventure simulations are included and they play just like the original BASIC games only in Small Basic:  Marco Polo, Westward Ho!, The Longest Automobile Race, The Orient Express, Amelia Earhart: Around the World Flight, Tour de France, Subway Scavenger, Hong Kong Hustle,  and Voyage to Neptune.  This Small Basic Programming eBook also includes the original kid friendly history lesson that goes with each simulation and a section explaining how the different Small Basic variables are used in each simulation game.  We also include both the original BASIC source code and the new Small Basic source code for old BASIC programmers who want to upgrade their BASIC programming skills to Microsoft Small Basic.

We are also about to re-publish the original "BASIC Computer Games - Small Basic Edition" book which was originally edited by David H. Ahl back in the 70s.  It includes the "Small Basic" source code for 100 of the original BASIC games including the classic Super Star Trek, Lunar Lander, Checkers, and MUGWUMP games.

All of our Small Basic Programming Tutorials and our classic David Ahl republished eBooks for kids (and adults) can be found here:

Friday, July 23, 2010 2:32 AM
•

Lesson 1:

- Make a deck of cards

Lesson 2:

- Remake deck of cards, iterating through suits

- replace items 11 - 14 with J, Q, K, A

Lesson 3:

- Random libraries (shuffle, deal)

Lesson 4:

- Play a simple card game (War comes to mind)

Also, another topic I felt was neglected in my day was file access.

- Build Scrabble tiles (letters + points)

- Deal letters to players

Get a list of Scrabble dictionary words, and access the .txt file, build possible words, rank by point value.

Honestly, I'd just use Python. They're going to have to deal with the reality of it all sometime, best keep them focused on other topics, they won't know the difference...

Smallbasic does look very low-maintenance, however. I wouldn't discount it, certainly. I was personally blown away seeing live postings of functioning programs in the forums. That definitely needs to be implemented with other languages!

Tuesday, August 30, 2011 8:24 PM
• I taught myself several languages, including C#, C++, C, VB.NET, Small Basic, Axum (of all things), and other programming languages. I know the fundamentals of programming and have an in-depth understanding of computers, runtimes, web developement, programming, etc.

I learned all this by doing these steps in a similar order:

• Learn the foundations of programming, not necessarily the basics.
• Learn what it means to be an variable, etc. and what the Small Basic library is.
• Learn the syntax and semantics of the language good enough so you can code with no help. Make careful sure they know the difference between the following two examples (and other things like it as well):

If x = y Then
' Do something
EndIf

' Is different than:

If x is equal to y then do something.

because of syntax specifications and that there are certain ways of doing things.

• A very important thing is scenarios and how you can use Small Basic in that scenario. Also what it can be used for and where it can apply to your day-day activities.
• Find out what you can do with the language.
• Explore the standard library or framework (in this case the Small Basic Library).
• Most important of all: experience, experience, experience. The more you use it, the more sense it will make to you and you will better understand it and will be able to solve complex problems with Small Basic over time.
• Above all: have fun! Beginners who like programming and working with computers and have fun using Small Basic are more likely to learn faster than those who don't enjoy it. If you are talking about teaching Small Basic to kids or teenagers, this is very crucial.
• If the person/people you are teaching is/are not too familiar with computers, make sure they have increased experience in that area as well. If they understand computers and how they work and how to use one, they will learn quicker, easier, and more painlessly (and with less stress, in some cases).
• Make sure you understand Small Basic. This may sound obvious, but make sure you have an in-depth knowledge and high experience with the language you are teaching.
• Personalize your approach: Does your student have a learning disorder but he still wants to learn Small Basic? Are they very good at paying attention? Are they young (as in less then 12 years of age), or are they older? Have they gone to university and studied computers? (If they have, they may be able to teach it to themselves on their own if you just give them links to websites, samples, the language specification, etc.) Have they finished school and/or gone to university and studied anything? (This will make it easier.) Do they speak fluently and know very well the language (i.e. English) the programming language is in and what language you are teaching them in, e.g. French. These are great questions to ask yourself about your student to personalize your approach, and you can come up with some other questions to ask too. Also, your student might have special needs to learn this, or how quickly they want to learn it (or how quickly you want them to learn it), if they badly want to learn, etc. This might affect the process/order you teach them.
• If your student badly wants to learn Small Basic for fun, be more organized and slow with your approach and let him/her get used to the current topic you are teaching them before you move on to the next and make sure they understand it (almost) fully; especially if they enjoy it.
• Important: Make sure you are having fun! If you do not enjoy teaching, programming, computers, etc., you probably shouldn't be teaching Small Basic or anything; unless it's your job and/or they really want you to teach them. Your student might sense that you do not enjoy programming (or do not enjoy something else, like computers or teaching etc.) and that might affect their learning the language and a little bit of that resistance might rub off on them.

Well, I hope this helps and have fun teaching and best regards!

- Nevin Janzen
Saturday, January 7, 2012 4:43 AM
• A few SB projects

(Note:  These are rough outlines, feedback welcome!)

1.  TextWindow

a.  Bowling scoring

i.    Given a file named "Balls.txt", and given the rules for how the score

is calculated, determine the line's final score.

b.  Converting Roman numbers

i.    Given the rules for forming Roman numbers, read and convert Roman to decimal.

(Note:  Both of these stress state changes, as in a State Transition Diagram.)

2.  GraphicWindow

a.  Reaction time I

i.    Delay a random number of seconds (say, 5 to 10)

ii.   Display a RED circle, start an elapsed milliseconds timer

iii.  Intercept mouse click, stop timer, display the reaction time.

iv.  Do the above ten times, then display the average reaction time.

b.  Reaction time 2

i.  As above, but display random non-red circles while counting down the delay time in a-i

ii.  As steps a-ii to a.iv

(Is there any major difference in the average reaction time between a and b?)

c.  A simple calculator

i.  Create a form having two text boxes and buttons "C", "CA", "+", "-", "*" and "/".  The text boxes are labeled "Input" and "Result".

ii.  "CA" event causes both text boxes to be cleared; "C" only clears the input box.

iii.  "+", "-", "*" and "/" perform the appropriate arithmetic operation using the input box value and the Result box.

ii.  Catch the keydown event for one of the text boxes.  Only digits allowed, any non-digit causes an error message, which stays until the "C" or "CA" button is clicked.

(Stresses event handling and input filtering)

d.  Combining a couple of the above projects, write another calculator that hancles Roman numbers instead of decimal.

e.  Explain "The Drunkard's Walk" (or if prefered, "Random Walk") (Google it!)  Write a program that:

i.    Performs a '* Walk" having of random-length steps.  Display the entire walk.  (What happens if a given segment tries to go beyond the window's edges?  Can you think of ways to avoid problems?)

ii.   Keep track of the total length of segments.

iii.  Every 5 steps, calculate and store: Total distance, average distance per step, distance between the end of the last line in the sequence and the starting point.  Use 100 steps total.

iv.  Display the data (could use TextWindow for this).

v.   Compare results with the expected results (square-root of the average step length * number of steps).  Ideally, calculat this value along with the above.)

(Stresses:  Arrays, use of Math object)

f.  A simple Kaelidoscope display

i.  Place random walk lines (length of each step between 5 and 20, number of steps between 5 and 10).  Make each line have a random color.  For a variation, make each segment a random color.

ii.  Reflect each line segment into the other three quadrants.  (How would you determine the coordinates for each quadrant?)

iii.  Mouse left-click clears the window, right-click pauses after all four quadrants have been updated and stays paused until another right-click.)

(Stresses use of Math object)

g.  Extend Project f to include ellipses and squares of random height and width.  (How do you determine where to ;ace the ellise/rectangle in the "other" quadrants"?  Clue:  Think of how things are reflected in a mirror.)  Use the "Fill" shape actions.

i.  Produce a random walk approximately 75% of the time, and one of the shapes about 25% of the time.

ii.  Add triangles to the mix.

RussPC
Thursday, January 12, 2012 9:49 PM
• Um, I know how to spell, but I can't type worth a hoot!

I just thought of another project, probably between e and f above:

Display a blank GraphicsWindow.

When user does a left-click in the window, a Turtly appears in a random position so many pixels from the mouse position.

Move the mouse toward the Turtle.  When the mouse is within some distance of the Turtly (say 100 pixels), the Turtle moves in a dirction that is along the line that connects the mouse point and the Turtle's position.  The rate of motion is inversely related to the disatance.  (The nearer the mouse is, the faster the Turtle moves).

(Turtle shoule "bounce" off the window edges.)

The goal is to catch the turtle.