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

Small Basic - The 50 Line Challenge

$
0
0

From Coding Cat:   

Working on developing projects for my Intro to Programming class, I reminded myself of an article I read back in the early days of the PC. The article was in one of the first PC only magazines, and it was publishing the results of a contest the magazine sponsored. Preliminaries complete, here is what they did:

They challenged their readers to come up with the most useful BASIC programs they could using only a single line of code in the BASIC interpreter. With the colon instruction separator you could easily get twenty commands on a single line. And the winning submissions were brilliant. One was a screen saver-esk art program, a second was a working word processor, and the third was a full sub chase game. I wish I could share the article and results with this group, but my net search for mention of the article turned up nothing.

So, in the spirit of the early days of PC programming, here is my proposal to all of you:

The 50 Line Small Basic Challenge!

I proposed this challenge about three years ago as the "25 Line Challenge", and it was such a success that it spawned a competition to see who could squeeze the most complex code into the smallest space. The results were brilliant. It was quickly discovered that you could use the String and Stack based nature of the arrays to produce some startlingly compact, obfuscated and unreadable code. I think the best example was Rock-Paper Scissors reduced to three lines (importCode: CTB433-2)

This time, to keep it from spiraling out of control and losing its impact on learning, I am going to suggest we keep it simple: One command or assignment per line, and no crazy use of arrays or other structures simple to squeeze into the limit.

So… Give us your clever, entertaining, most creative best, just keep it readable, and keep it under fifty lines.

 

Thanks to...

Avatar of Nonki Takahashi Nonki Takahashi - For suggesting this blog idea!

Avatar of Coding Cat Coding Cat - For creating and hosting the contest!
 
 
 
Now get in there and beat the challenge! Ask questions and discuss it here: http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/1025bfd4-9c6f-4680-9bcd-f664a999eacb
  
   - Tall Basic Ed
 

Small Basic Program Gallery

$
0
0

12/08/15 UPDATE: Oculus Rift Ball Bounce, Batting Practice, Database Sample, Wavelength to RGP Converter, Clown: Parsed Pixels, and Pendulum.  On 11/17/15: Added several Science related programs, Triple Six, and Small Block Builder. On 9/3/13: Added Eora Duck Hunt. On 6/29: Added SBCraft. On 6/12: Added String Searcher. On 5/22: Added Abacus Beads, Chomper, Go Simulator, Minesweeper, Piano, and Shapes Editor. 

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

The goal is that this list contains a lot of Small Basic programs. We're looking for interactive programs that are easy to use, fun, and have little to no learning curve.

To browse a larger variety of programs that are listed categorically, see Small Basic Program Gallery - Listed By Category. Categories include Games, Graphical, Math, Physics, Productivity Apps, Sciences (Other), Sound, and Text.

You should also come back later, because this list will evolve over time.

 

#

1942 - by Laurent20

A

Abacus - by Harry Hardjono

Abacus Beads - by Nonki Takahashi

Alien Barrage (info) - by LitDev

Analogue Clock (with wood texture) - by Math Man

Analogue Clock (no background) - by Nicolas_br

Arrow - by Zock77 

Asteroids V2 - by Jason Jacques + Community

Atom - by Dudeson (follows mouse cursor)

B

Balance Scale - by NaochanON 

Basketball - by NaochanON

Batting Practice - by Cody_M

Blackboard - by Vijaye

Block Smasher V2 (info) by Behnam Azizi

Blimp - by  Coding Cat

Brick Wall (info) - by Stendec

C

Calculator - by  Alex 2000 

Calculator CA - by Nonki Takahashi

Cargo Weight - by NaochanON 

Catch Game - by NaochanON

Chess Board - by Nonki Takahashi

Chomper (Packman) - by Anthony Yarrell/QBasicLover

Click the Button - by Timo Sö

 

Clown: Parsed Pixels (info) - by Jibba Jabba

Code Block Generator v1.3 (info) - by Nonki Takahashi

Collision Physics - by Litdev 

Color Memory Game - by Martmen

Color Picker - by Suduadib

D

 

Database Sample - by  

Decimal to Binary Converter - by Amir CPS

E

Eurora Duck Hunt - by Jibba Jabba

Eyeballs - by Math Man

F

Football Pong (P1 use S+D; P2 use K+L) - by Nonki Takahashi

G

Go Simulator - by Nonki Takahashi

Gorillas - by Rushworks

Graph - by NaochanON

H

Happy Number Checker - by Math Man

I

Installer (info) - by Timo Sö

Invader (game) - by NaochanON (play locally for proper framerate)

Invaders - by JKrueg 

L

LED Display - by Amir CPS

Light Beam - by Math Man

Light Beam - Interactive - by Zock77 (press up and down to rotate the reflector)    

M

Metronome - by NaochanON

Minesweeper - by Nonki Takahashi

Moon Phases - by NaochanON 

Music Player (info) - by Amir CPS, NaochanON, and Absolu

N

Number to Text Converter - by Math Man

O

Oculus Rift: Ball Bounce (info) by Zock77

P

Pacman Labyrinth - by LitDev

 

Pendulum (info) - by Jibba Jabba 

Pendulum Clock - by Nonki Takahashi

Pendulum Clock 2 - by Kevin J

Pi Clock - by Math Man

Piano - by Nonki Takahashi (run locally)

Pyramid - by NaochanON (be patient)

R

Random Cat Clock - by NaochanON 

Random Drawing - by Math Man& Coding Cat

Ruler - by Nonki Takahashi

S

SBCraft - by Ardiezc Quazhulu

Shapes Editor (info) - by Nonki Takahashi 

Silly Story Writer - by Talgon96 (run locally)

Sierpinski Triangle - by Stendec 

Small Block Builder (info) - by Bluegrams

Smiley Maze Game - by Nik Coughlin

SnakeBite - by Davey Wavey

Soda Pop Showdown - by JKrueg

SokoCUTE - by kts99

Sorting Algorithm Demo - by Zeven

Space Invaders - by Davey Wavey 

Spring - by NaochanON 

Star Catcher - by NaochanON

Star Field Simulator - by JKrueg

Starfield Simulator 2 - by Florian Auer

Stay Away from the Blue Ball - by Todd

String Searcher - by Jibba Jabba

Super Pong - by Litdev

T

TanCraft - by Behnam Azizi 

Tankinator - by Zock77& Cobra355

Tetris - by Kenneth Kasajian

Text to Binary Converter - by Amir CPS

Text Writer - by Todd

Tic Tac Toe (with menu) - by Nonki Takahashi

Tic Tac Toe (with tough AI) - by NaochanON

Tower of Hanoi - by Alex 2000

Triple Six (info) - by Bluegrams

Turtle Maze Game - by (info) - by Nonki Takahashi

V

Vigenère Cipher (info) - by Amir CPS (run locally)

W

Water Clock - by NaochanON 

Wavelength to RGB Converter - by Pappa Lapub

Weather (USA) - by NaochanON

  

Leave a comment with more programs to add. We'll need a name, a link to download it, and the name/profile of the developer. On TechNet Wiki, you'll find a version of this article that lists even more programs. (This blog post is limited to interactive programs that are easy to use, meaning they have little to no learning curve.)

Thanks!

   - Tall Basic Ed

What are the 14 Keywords of Small Basic?

$
0
0

In the Small Basic FAQ, it mentions there are 14 keywords:

What are the unique features of the Small Basic language?

  • Size
    The Small Basic language consists of just 14 keywords.

==========

Of the 14 keywords, we'll cover 16 of them in this blog post:

And
Else
ElseIf
EndFor
EndIf
EndSub
EndWhile
For
Goto
If
Or
Step
Sub
Then
To
While

==========

Examples...

 

If, Then, EndIf

If (Clock.Hour < 12) Then
  TextWindow.WriteLine("Good Morning World")
EndIf

Else

We can shorten two if..then..endif statements to be just one by using a new word, else.

If we were to rewrite that program using else, this is how it will look:

If (Clock.Hour < 12) Then 
TextWindow.WriteLine("Good Morning World") 
Else TextWindow.WriteLine("Good Evening World") 
EndIf

Goto

If (i < 25) Then 
Goto start 
EndIf

For, To, EndFor

For..EndFor is, in programming terms, called a loop.  It allows you to take a variable, give it an initial and an end value and let the computer increment the variable for you.  Every time the computer increments the variable, it runs the statements between For and EndFor.

This program prints out numbers from 1 to 24 in order: 

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

Step

But if you wanted the variable to be incremented by 2 instead of 1 (like say, you wanted to print out all the odd numbers between 1 and 24), you can use the loop to do that too.

For i = 1 To 24 Step 2 
TextWindow.WriteLine(i) 
EndFor

While, EndWhile

The While loop is yet another looping method, that is useful especially when the loop count is not known ahead of time.  Whereas a For loop runs for a pre-defined number of times, the While loop runs until a given condition is true. In the example below, we’re halving a number until the result is greater than 1.

number = 100 
While (number > 1) 
TextWindow.WriteLine(number) number = number / 2 
EndWhile

Sub, EndSub

A subroutine is a portion of code within a larger program that usually does something very specific, and that can be called from anywhere in the program.  Subroutines are identified by a name that follows the Sub keyword and are terminated by the EndSub keyword. Below is a program that includes the subroutine and calls it from various places.

PrintTime() 
TextWindow.Write("Enter your name: ") 
name = TextWindow.Read() 
TextWindow.Write(name + ", the time now is: ") 
PrintTime() 
 
Sub PrintTime 
TextWindow.WriteLine(Clock.Time) 
EndSub

And, ElseIf

  If  percentage >= 75 Then

    TextWindow.WriteLine("The student’s grade is A.")

  ElseIf  percentage < 75 And percentage >= 60  Then

    TextWindow.WriteLine("The student’s grade is B.")

  ElseIf  percentage < 60 And percentage >= 35 Then

    TextWindow.WriteLine("The student’s grade is C.")

  Else

    TextWindow.WriteLine("The student’s grade is D.")

  EndIf


Or 

Sub subRainyCount

    If Rainy = "y" Or Rainy = "Y" Then

       RainyCount = RainyCount + 1

    EndIf

EndSub

  

Why are there 16 Keywords instead of 14?

Okay, so that was a bit of a joke. Sorry if it was lost on you. Usually when you say/read/hear "Of the X items, we'll cover Y of them..." the Y number is smaller than the X number, not larger.

"And" and "Or" are actually Operators, and they don't count as the Keywords.

So the Keyword list looks like this:

Else
ElseIf
EndFor
EndIf
EndSub
EndWhile
For
Goto
If
Step
Sub
Then
To
While

And the Operator list:

And
Or

   

If you'd like to write up some short explanations of some of those keywords, I'll add your explanations above the examples. Just leave the suggested text in the comments!

Thanks!

   - Tall Basic Ed

 

Small Basic Extensions Gallery

$
0
0

UPDATED 02/28/16: Added Jibba Jabba's Small Basic Leaderboard, Extended Text Library (by jsakamoto), Fast 2D Graphics (by FuleSnabel), Kinect (by Synergist), Neural Network (by EzyMCP), and SquareBasic (by Benedikt Muessig). On 01/31/16: Added Fremy's Extension as a featured extension. On 11/2/15: Added LitDev and EV3 Basic. On 6/13/13: Added Timo So's MoreOptions Extension. On 5/31/13: Added NaochanOn's Barcode Extension.

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

FEATURED EXTENSIONS:

 

The impossible goal is that this list will eventually contain every quality extension made for Small Basic.

I'm starting with some listed in the Small Basic Forums, but you should also come back later, because this list will evolve over time.

 

B

Barcode Extension - by NaochanOn

D

-

E

ESL Extension (v.10a) - by Liam McSherry

EV3 Basic (info) - by Reinhard Grafl & Nigel Ward

Excel Library for Small Basic - by JSakamoto

Extended Text Library for Small Basic by jsakamoto

F

Fast 2D Graphics Extension by FuleSnabel

Fremy's Extension (v2.3.1) by FremyCompany (for both SB v1.0 and v1.2)

I

I/O Extension (v1) - by Noah Buscher and gungan37

IE Library for Small Basic - by JSakamoto

J

Joystick/Game Controller Extension (v1, prereq, how to) - by gungan37

K

Kinect for Small Basic Extension Library (for SB v1.1, included in SB v1.2) - by Synergist

L

LitDev Extension - by LitDev

(No longer available: LitDev Demonstration C# Extension Set) - by LitDev

M

Math Extension (v.01) - by Zock77

MoreOptions Extension (v0.2) - by Timo Sö

Moving Extension (v1) - by Math Man

N

Neural Network Extension - by EzyMCP

P

PlusPlus Extension (v2) - by gungan37

Power Array Extension (v1) - by EzyMCP

PowerExtension (VB.net) - by Noah Buscher

S

SayPlus! VB.net Extension (v1.3.2) - by AshkoreDracson

Small Basic Leaderboard (info) - by Jibba Jabba

SquareBasic (v0.61) by Benedikt Muessig

T

Teaching Extensions (v .034) - by LynnLangit& TeachingKidsProgramming

W

Windows Forms for Small Basic (v 2.0) - by gungan37

X

XExtension - Leaders Board for Small Basic (v1.0) - by Jibba Jabba (for SB 1.2)

 

Archived

These are older extensions that seem to no longer be working or are no longer available:

Data Extension (v1.0.3) - by Oskariok

Fast 2D Graphics Extension - by FuleSnabel 

 

You can upload your extensions either at the MSDN Gallery, GitHub, or at CodePlex. In MSDN Gallery, you earn Recognition Points and Achievement Medals in the same system as the Small Basic Forums and as TechNet Wiki, where you can create how-to and troubleshooting articles about Small Basic scenarios.

Leave a comment with more extensions to add. We'll need a name and a link to download it. Find the community version of this gallery over on TechNet Wiki.

Thanks!

   - Tall Basic Ed

 

See Also

  

 

6 Lessons to learn Small Basic and graduate to Visual Basic!

$
0
0

Learn how to use Small Basic and to graduate to Visual Basic... in 6 steps!

Lesson 1: Getting Started with Small Basic

Lesson 1.1: Introduction to Small Basic - Estimated time to complete this sub-lesson: 30 minutes

Small Basic

Lesson 1.2: Statements, Properties, and Operations - Estimated time to complete this sub-lesson: 1 hour

Lesson 1.3: Variables- Estimated time to complete this sub-lesson: 1 hour

Lesson 1.4: Conditions and Loops - Estimated time to complete this sub-lesson: 1 hour

Lesson 1.5: Branching and Subroutines - Estimated time to complete this sub-lesson: 1 hour

Lesson 2: Graphics Window

Lesson 2.1: Introduction to Graphics Window- Estimated time to complete this sub-lesson: 1 hour

Graphics Window

Lesson 2.2: Turtle Graphics - Estimated time to complete this sub-lesson: 1 hour

Lesson 2.3: Exploring Shapes - Estimated time to complete this sub-lesson: 1 hour

Lesson 2.4: Sound, Program, and Text Objects - Estimated time to complete this sub-lesson: 1 hour

Lesson 2.5: Clock, Desktop, and Dictionary Objects - Estimated time to complete this sub-lesson: 1 hour

Lesson 2.6: Flickr, ImageList, and Network Objects - Estimated time to complete this sub-lesson: 1 hour

Lesson 3: Input and Output

Lesson 3.1: File Input and Output - Estimated time to complete this sub-lesson: 1 hour

ReadContents operation

Lesson 3.2: Stacks and Arrays- Estimated time to complete this sub-lesson: 1 hour

Lesson 3.3: The Math Object- Estimated time to complete this sub-lesson: 1 hour

Lesson 3.4: Events and Interactivity - Estimated time to complete this sub-lesson: 1 hour

Lesson 3.5: The Controls Object - Estimated time to complete this sub-lesson: 1 hour

Lesson 3.6: Debugging Aids- Estimated time to complete this sub-lesson: 1 hour

Lesson 4: Making Your Game

Lesson 4.1: Playing with Shapes - Estimated time to complete this sub-lesson: 1 hour

Lesson 4.2: Responding to Events - Estimated time to complete this sub-lesson: 1 hour

Lesson 4.3: Collision Detection - Estimated time to complete this sub-lesson: 1 hour

Hit the Target game

Lesson 4.4: Advanced Games - Estimated time to complete this sub-lesson: 1 hour

Lesson 5: Share

Lesson 5: Sharing Code - Estimated time to complete this sub-lesson: 1 hour

Small Basic programs

Lesson 6: Graduation Ceremony

Lesson 6: Graduating to Visual Basic- Estimated time to complete this sub-lesson: 1 hour

Small Basic

 

  

Anybody make it through all 6 lessons? And post a comment if you have a better time estimate for these sub-lessons!

   - Tall Basic Ed

Small Basic - Elementary & Middle Student Testimonials

$
0
0

Last Updated: 09/23/15JCGarrido's son, Adrian, age 12. 11/28/14: Der_Programmier, age 9. 10/21/13: Added Anne's son. 8/25/13:Added Lisa M's daughter, Amber. On 6/20/13: Added 8Bit Pony. On 6/10: Added Michelle P's son, Heather H's son, and Jalynn P's kid. On 5/27: Added Leslie E's sonEddie D's daughter and Linda B's son. On 5/26: Added Jennifer L's daughter, Elizabeth. On 5/25: Added Leah C's son, Charles

This blog post is a work in progress. It will grow as we collect testimonials. Please add to it by leaving comments below. Please include the age and grade of the child and then a paragraph that explains how well the student was able to learn Small Basic. It can be a story, an example, or in any form you'd like. We'll list the youngest students at the top. We're looking for students age 1-13.

Below you'll find testimonies about 49 students, age 8-13. 

To get started with Small Basic, see the Small Basic Getting Started Guide, the Small Basic Teaching Curriculum, and the Small Basic E-Books

 

Index:

Age 8

 

Ray FAST's son, age 8, 3rd grade:

I taught my little one the concept of DLL.  Now he understands he needs the dll and .exe to run a SB program.  It wasn't too difficult for a 3rd-grader to grasp the concept :)

  

LitDev's 2 daughters (Scotland), at age 8:

(They are currently 11 and 12). They  use [Small Basic] mainly to create little graphical programs, lots of bright colors.  The first extension I wrote was for them that speaks text - mostly insulting each other!

Here are examples: GQL381 (look for the hidden message) and FVV083 (must run locally; uses LitDev extension) of the kind of thing they wrote.

 

Back to top  

Age 9

 

Math Man, at age 9, 4th grade:

I am 10 years old. I went through the first few Curriculum Guide lessons with another classmate and a teacher when I was 9, but after that, I just felt like going at my own pace, so I went ahead and self-taught myself the rest of them. I was doing around 3 or more lessons a day, and it was very fun seeing the results of what just a few lines of code could do. I decided that it got boring just copying those already written programs into the Small Basic UI, so for every lesson, I tried to make my own program using what I had learned from all the lessons I had done. I was making programs to draw a man growing chicken pox, have the user control the turtle to eat apples, and other miscellaneous things. Now, from all that I have learned from looking at others' programs on the Small Basic forum, I have memorized basically all the objects, properties, functions, and keywords of the Small Basic language and how they are useful. In fact, I have actually learned what the sine and cosine functions can do while writing programs. I have been monitoring the Small Basic forum for a long time, but I didn't have an account here until a while ago. I like helping with others' problems on this forum and writing miscellaneous programs.

Update... I am now 11 (as of March 2013) and have been learning Java and C (with the help of both of my grandpas and my dad along the way) and am understanding OOP (object-oriented programming) pretty well. I still get plenty of bugs, run-time errors, and compiler errors, but at least now I know how to handle 'em. I probably would never have been able to do all this without Small Basic. Thanks, guys!

  

Michael Scherotter's son, Alex, at age 9, 4th grade (with 2 girls and 7 other boys, all 4th grade):

This past week I had a great time teaching my 9-year-old son Alex and 9 of his friends computer programming in my home.  I used Kodu Game Lab and Small Basic, two free tools created for kids to learn programming. 

My son Alex, age 9, wants to learn about computer programming so I decided to try something fun – to teach it to him.  In my day job, I explain and demonstrate Microsoft’s software development technologies and I’ve been programming since I was about ten so I think I know what to do.  I wanted to do something really fun for Alex, and kind of adventurous, so I invited 9 of his friends to join him and next week I will be teaching a group of 8 boys and 2 girls programming in my home on my dining room table.  Each camper will be bringing their family computer... (1 Week Later)...

Small Basic is an easy-to-use version of the BASIC language that I first learned to program with on Radio Shack TRS-80s. As Lou Reed said, “it’s the beginning of a great adventure”. We started out with learning about the Small Basic programming environment, and got familiar with the idea of statements, properties and how to write code and run it.  We were also able to cover variables, conditionals, and loops with a number of exercises along the way where the campers experimented and tweaked their programs until they had something that might make the other campers laugh.

Then we got to the turtle.  Small Basic has a “turtle drawing” mode where you can enter commands to make a turtle move and draw with just a little code... Turtle.Show() Turtle.Move(20) Turtle.Turn(45)

That’s when the kids lit up.  They saw that their actions with code made drawings on the screen.  I then introduced the idea of the loop that they learned earlier and they started to make designs with repeated turns and moves.  Once I showed them that you could add color and change the turtle’s speed, there was no stopping them.  At that point, the decibel level in the room rose exponentially as the campers created programs and showed them to their friendsThis was big fun!  Take a look.

Alex, age 9, learning Small Basic:

   

Lisa N's daughter, Flower, age 9, 5th grade:

I've been looking for something like this for a long time and was not disappointed! ... Flower (5th grade) started it and has been moving through it at a reasonable pace, but enjoying it just the same... Programming is just learning another language, a needed language for the 21rst century. Read the full review.

   

Der_Programmier, age 9, 4th grade:

I started Small Basic in fourth grade.  The first program I made without instruction was a simple "Hello World" console program in yellow text.  My languages of choice are now C# and ASM... I am starting to learn Java and C, though.  Small Basic and [then] Visual Basic definitely gave me a start in doing these things.  I am now going into eighth grade (13)  and hope to perfect LightningOS and eventually add ThunderScript to it.

People who are starting with SmallBasic -- Keep going!!! This is just the beginning!

   

Alex_2000 (Russian), at age 9:

I am 9 years old. Now I am studying Small Basic with my daddy. But it is not enough materials for children education (in Russian). My daddy is creating a studying book for me, because I am not very good in English yet.

   

Back to top 

Age 10

 

Mark Derksen's son, age 10:

Thanks to Small Basic, My son (10 years old) has taken his first steps as a developer. His enthusiasm proves to me, you are on the right track! As a .Net developer, this make me a very proud father.

  

Jannelle Nevel's son, age 10:

Like many kids his age, my oldest son LOVES technology and gadgets... As I look for ways to help him think like a creator/inventor/business man and not just a consumer, computer science sounds like just the thing we should try next! ... I liked the program and how it made something like computer science understandable to my son... The program is a great introduction to more complex computer languages (i.e. C++)... I enjoyed how this program made teaching computer science not just possible, but fun! Read the full review.

Jannelle's son (10):

   

Sarah A's son, age 10:

My oldest son loves computers!  To make school more enjoyable for him, I try to incorporate the computer into his schooling when I can... I used this tutorial with my ten year old son.  We worked at the suggested chapter-a-week pace, an average of four days a week, and that seemed to be just right for us (mom was learning too)... We would follow any examples or build any applications as we came across them in our reading. The applications were broken down, step-by-step, making them easy to build... He was quite anxious and excited to build his first computer program... He didn't seem to have much trouble with some of the math concepts that he hasn't learned yet (like square roots), and he would progress naturally to the next step of several applications without even having to read what to do next.  I feel that this is an excellent, thorough, beginner's course for computer programing. Read the full review.

 

Heather H's son, age 10:

Your child will learn about program design, text window applications, and graphic window applications... My son is 10.5 and he is interested in computers and anything "techie"... Just when I would think he was going to complain or be confused, he'd amaze me with his understanding... No prior programming experience is necessary. Read the full review.

  

Jalynn P's kid, age 10:

It causes the student to slow down and take their time. My two older children, ages 15&10 were forced to really think it through and examine things, which is a plus. Read the full review.

 

Back to top 

Age 11

 

Laura's daughter, Therese, age 11:

Therese (11) constantly surprises me... She didn't want to stop, and somehow, I just couldn't hear myself saying, "No, Therese! You may not continue your computer programming course after dinner! Come watch television with the family!" ... she has basically treated this far more like a core course than an elective, meaning that she has been doing it non-stop.

She finishes a lesson and then plays around with what she learned for a little while, and then moves immediately to another lesson... She didn't want to stop working (even though it was 7 p.m. and I in no way encouraged her), so she just trucked the laptop to her brothers' [Tae Kwon Do] lessons. Read the full review.

Therese (11), teaching herself Small Basic:

  

Vivian Luo's son, age 11:

I am 11 years old. I started to learn programming weeks ago. My mom’s friend taught me to learn from the curriculum. Small basic is so cool. It is easy to learn, easy to get results. I hope I can develop my first game and program robots soon.

 

AirWaves, at age 11:

I started using Small Basic when I was 11, around two years ago, and I was amazed at how simple coding actually turned out to be. Learning a language like this is probably the best step one can take in their path to learning more advanced languages. Since then I have learned 5 other languages, but I can still look back at how far I came, and remember the good old times.

Thanks Small Basic for launching my life into a better direction.

  

Michelle P's son, age 11:

I even had my son create his own program based on my 6 year old's favorite question.  "When I am 10 years old how old will my brother/sister be?"  Our program now allows him to type in an age and it will show him how old each member of the family will be.  This... is a pretty simple program, but it did show my son how he could "see the need" and create a program for the computer to do the work for him...

The "age" program:

All in all we enjoyed... discovering what Microsoft Small Basic could do.  I would recommend using this program to get your youngster started as a computer programmer... It was fun to see [father and son] work together to solve a problem and even more fun when they would call the rest of our family in to show us the latest program they had created.  I am eager to see what they will program next as they continue these lessons together...  I am thankful my husband is walking him through it, but I have seen that I could do it as well.  Actually, now that he has gotten started, he is quite capable on his own. Read the full review.

Dad explaining Small Basic to his son, age 11:

  

Linda B's sons, Brent (age 11) and Caleb (age 12):

My boys are ages 11, 12, 14 years old... What they learn in this program will prepare them for more complex programming languages... My boys are very excited about this program. They have been working on it for a little over five weeks and they are still enthusiastic about it. That right there tells me that it's a keeper. It's been a bit of a challenge at times for them but that’s a plus because they are working through the challenges. Their dad is there to help but he lets them figure things out. Quote from their Dad: “This program is great because a parent who has little or no knowledge with computer programming will be able to teach their child(ren)... Read the full review.

 

Fred Postnov (Russian), age 11, 5th grade:

When I was 9, I was a real computer gamer. My dad taught me some 3DS Max, and I really liked making entities and space ships. But one day, I realized that perhaps video games are created somehow, and I asked my dad what was the secret of programming. My dad said that he knew almost nothing except Basic. He told me it was very old, and stuff. But I asked him: can you please somehow show it to me?

He found the compiler in a few days. And however Basic was small and easy, I still felt like a god of possibilities. Later, when my grandfather found out I was actually programming, he called us on Skype, and he told us he found an awesome program on the Internet (Small Basic), and gave us a link. When I downloaded it, I didn't quit my computer for days, because I was programming.

     

Back to top 

Age 12

 

Jennifer L's daughter, Elizabeth, age 12:

Liz quickly became very comfortable with the lessons and completed them all by herself and called me {constantly} to come see her fun little creations... Elizabeth loved learning about the history of computers and programming in the first lessons...

Elizabeth's dad is getting it started:

 

She likes the “games.” She likes the control and learning how changing just one letter or character can change the whole program. Her analytical mind at work! I love that she is learning about computers... It’s great help to her in math since she has to calculate the size of shapes or borders within the graphics... Then she was on her own. She was all proud of herself and showing me all these little “games” she wrote. She self-corrected her code when they didn’t work just the way she wanted. Dad helped her change them and showed her different options. Then she ran with it. I am thankful that we can utilize the kids’ desktop computer and my laptop so Liz could have the lessons up and do her code at the same time... The true test is that she can explain to me why the shape is filled in or outlined in a certain color and which code is needed to make it do what she wants! I noticed yesterday she completed all 11 lessons... Me: “If you like it, I will purchase the next book for you.” Liz: “I thought you already had the whole program for me. I want it all!” And that’s a good review. A typical lesson only takes a few minutes (tweaking and playing can take much longer!) so many colors, choices, sizes, codes…it’s like a new toy! She has this last on her daily list as an incentive to complete her other workRead the full review.

Liz (12), teaching herself Small Basic:

 

Lisa M's daughter Amber, age 12:

[Amber] was so excited that she asked if she could try and figure it out on her own. She pulled up the Small Basic program & the PDF containing the instructions and got to work right away. I'm not sure how long she worked on this every day, but I never had to remind her about it.

She had a blast& every little bit she would holler at everyone to see what she had done... Amber loves working with the Small Basic program, and she is already asking for more. This is a great program for a beginner programmer. It was easy enough for her to use & she was very excited with the results of her work. Read the rest of the review.

Amber (12) taught herself Small Basic:

 

CodeWizardKid1 (Tim), age 12:

I am a 12-year-old that had taught myself Small Basic. Small Basic is helping me, and it wasn't very hard to learn at all. Even with me (who had no previous experience), it is very valuable. I love programming now, and lastly it did bring me to learn another programming language. Before I learned Small Basic, I NEVER understood anything about programming. And that all changed one day when I stumbled upon this site.

 

Leah C's son, Charles, age 12:

I knew Charles (my 12 year old) would have an interest in learning basic programming... He took off through the lessons... The lessons were easy for him to comprehend for the most part. He worked through entirely self-directed... He has had only good things to say about the program. He's very excited about all he's learning. And he often chooses to do the program even if I haven't assigned it for the day. This has definitely been successful for us, and I'm glad we've had the opportunity to use it. Read the full review.

Charles (12), teaching himself Small Basic:

  

Eddie D's daughter, M, age 12:

M took it and dived right in... The lessons teach them how to create [games] and a whole lot more. It also teaches them how to self-correct, which is wonderful... So easy to follow that even I found myself interested and wanting to try it... These lessons made M think, but she did not struggle AT ALL and was able to work independently on each lesson...  Can you see in today's world, how something like this would be an incredible asset to a *** or teen as they head towards adulthood? Read the full review.

 

Gungan37, at age 12, 7th grade:

I learned Small Basic when I was 12, while I was in 7th grade. I can remember the feeling I got when I found Small Basic on the Microsoft Download Center. I read the description and immediately downloaded it. I showed my parents the “Hello World” program I made and kept on going, next writing a Fahrenheit to Celsius converter. In a couple of years, after mastering Small Basic, I went on to C#. I quickly picked up C# by looking over code by Litdev, a Small Basic extension developer and community contributor. Within a year of that, I learned x86 assembly (picking up some C and C++ along the way), then Visual Basic, TI-Basic for calculators, J# and Java. Now, I am a 10th grade and am working on an operating system, CM-DOS, which is in C# and assembly language. Without the Small Basic Language and the very helpful community (such as Litdev), I would not be an OS developer and programmer today. Thanks guys! 

 

Amir CPS (Indian), age 12, 8th grade:

I am Amir a 12 year old 8th grade student from India. The story began when our school organized a visit to Microsoft India center last year. A guy from Microsoft gave us a presentation how small school children can easily learn the concept of "Computer Programming" using Small Basic. Now Small Basic is being taught in our school instead of "C++" which was like a nightmare for us and I used to think that there are pre-defined codes for every single task. I was wrong though. Thanks to Small Basic it helped me to learn the "ABCD" of programming and now I can transform my imagination right into the computer program.

 

Tere S's son, age 12, 7th grade:

My son is 12 years old and is in the 7th grade. He found it extremely easy to use. There are more challenging exercises included that are intended for 7th through 12th graders, and he kept begging me to complete those as well. Of course I said yes. How often do I hear my son beg to do school work?Read the full review.

These are screen shots of the programs and games he created:

 

  

Lisa N's son, Cub, age 12, 7th grade:

This is a super easy to use, easy to succeed at, beginning programming course... Both Feeche (age 18, 12th grade) and Cub (age 12, 7th grade), with no previous programming experience, have spent hours delving into this curriculum. After just a few weeks, they are both almost done with the first semester, with high hopes of having the 2nd semester available to them soon! ... Cub is farther along then anyone, and occasionally has to ask Feeche for help, but it's simple enough to figure out that they continue moving along at light speed.  Read the full review.

 

Creative One, at age 12:

I started at 12 (13 now), and I have to say, Small Basic is quite fascinating. The UI is well designed, the code pretty much works the way its expected, and you have ultimate control of the programming.

 

8Bit Pony, age 12:

I started programming with Small Basic two or three months ago. (I'm currently 12.) I have learned a lot, I must say! ... I am self-teaching myself coding. It is more difficult than learning from a teacher, but it is a nice challenge, and i think it's more enjoyable... Then I started getting into it. I was going through the curriculum very fast. I am already almost done with it! I am very thankful Small Basic is free and that it exists! My favorite feature of small basic would have to be it's simplicity. It's simple and easy to learn, yet you can make some pretty cool games and apps with it!

 

Flostian, at age 12:

I'm now 13, and I started programing when I was 12. I first started with an easy German language (because I am a German), but it had a lot of functions, which it does not explain. Because the language was German, there wasn't many people who were using it and could it explain to me.

I started to code in Small Basic.

It's really fascinating to code things that seem to be very easy and operations you usually do automatically in your mind; because it's really funny to see how bright such a simple thing can be. And of course it's a wonderful feeling to see a program working if you had spent a lot of time writing it.

  

JCGarrido's son, Adrian, age 12:

In the words of his parent, "This program, developed by my 12 years old son, Adrian, provides a planet movement simulation, with an acurate rotation period simulation".  Read more here.

  

Back to top 

Age 13

 

Leslie E's son, Captain C, age 13:

I was excited to get to share my love for computers with Captain C... I wasn't sure how intense the lessons would be. When you think of computer programming, I know many people shudder and C was the same way. He thought it sounded cool, but that it would be too hard... We sat down and started going through it together... He caught on quickly. YAY! ... He was breezing through this and really understanding it. He would do the activity included, then change it up a little and personalize it... He is excited about the games he gets to start making. It might not take as long if he didn't play with each example and tweak it, but I think that is the fun part of learning. Once he learns how to do it, he can then make it his own. I don't have to sit with him and do it all, but he does it at the kitchen table so I can be close by to help if needed. One thing about computer programming is if you are just BARELY wrong (like a missed letter or dot or anything), it won't work...

What I love about the Small Basic program, is if you make a mistake, it immediately tells you what line the mistake is and what needs to be fixed. Once C figured that out, he really got moving on it. He would put in random things, hit run, and then see what needed fixing to make it work - haha. Small Basic also has a great feature where it offers help as you go. Like here, he started typing "textwindow" and the program guessed what he was writing and offered all those "helps" for him. What a great tool for learning programing!

Small Basic uses Intellisense to give Captain C the help he needs:

C is really enjoying it... I can't wait to see what he can do after he finishes all the lessons. Kids these days have such a bend towards video games and computers so I'm thrilled to have found this where he can still have that outlet, but be learning and building too. And also thrilled to have another computer geek in the making here....someone to speak my language. ;o). Read the full review.

    

Noah Buscher, age 13:

I am 13 years old, and I think [Small Basic] is a great way to get kids and adults alike into the world of programming. I think that the simple UI makes it easy to focus on the code, and not the hassle of some more advanced languages.

  

Zock77, at age 13:

I have been wanting to program since I was around 8 years old, but all the languages I found were just too big of a step. (Even with a bigger brother who knows almost all of them.) But then my Dad found Small Basic, and I have been programming with that. I started at 13 (I'm 14 now). Now I'm just stepping into Visual Basic!

 

Kelly B's son, Hayden, age 13:

Hayden was excited to try out this course!  He’d never attempted any type of programming previously, so this opened up a whole new world for him. Hayden was able to sit right down and begin the first lesson without any help from me whatsoever... Hayden was so excited that he actually made something work!  He came running downstairs jumping up and down and couldn’t wait to show me! ... He input a sample code that caused the computer to ask a series of questions, where it repeated his answers back to him.  He thought that was pretty cool, and he asked me to come try it out for myself... He is quite anxious to get to the end so he can create some fun games to play and see just what can be done with the Small Basic language! Read the full review.

Hayden, teaching himself Small Basic:

 

Joman Mied, at age 13, 8th grade:

I had been looking for programming software since I was 12 (grade 7), and I found Small Basic when I was 13 (grade 8). I worked through the tutorials one at a time, and because of the language being easily comprehensible, I caught on fast! To this day (grade 10), I am still learning new things about it, but I am able to make some cool (but simple) programs. I love how Small Basic uses a language close to English; easy to use "psuedo-code" if I forget something. Small Basic is a great first step to programming, and I am so glad I found it!

As of February 2013, I am already building my Small Basic knowledge up to VB, Javascript, and C++. Thank you to those who built the Small Basic language and the IDE for helping me create a sturdy foundation that I can, and have started to, build upon to reach my goal!

I still think that Small Basic was a great beginning language because it not only uses a lot of close-to-English type syntax, but also uses the fundamental properties that all languages use. With this knowledge and a great start into programming under my belt, I shall continue with my goal of programming for Microsoft!

 

Anne's son, age 13:

He enjoyed using the program and found it very user friendly... I didn’t have to do much to help my son with this course...  We both thought this... provides an excellent introduction to computer programming that isn’t overly difficult for a beginner, but still provides plenty of challenge. Read the full review.

Anne's son taught himself to make programs like Card Wars, in Small Basic:

sb1

 

Karen Morris' son, age 13:

My children were really exited to learn about programming games... My 15 year old daughter also wanted to learn how to program, so I let her also use the curriculum. I had so much fun in the early days programming my computer. I want my children to experience the joy of making a machine seem to think. After they finish learning Small Basic they can learn a more sophisticated language. They may decide to take programming in college and become a programmer. All of us found that the curriculum was easy to use. The language of the text was easy to understand. My children have also had fun doing the simple programs. Read the full review.

     

Back to top 

  

Please keep the testimonials coming! Leave a comment below, with...

  • The student's age and grade
  • A story, example, or other explanation of how the student was able to learn Small Basic.

The only other guideline is that we're looking for testimonials about students, age 1-13. (This was updated from age 1-12 because we saw that we have many active 13-year old contributors.)

 

To get started, download Small Basic, and then see the...

 

Thanks!

   - Ninja Ed

Small Basic Featured Program - Turtle Maze

$
0
0

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

Nonki updated this game on 12/3/12: http://smallbasic.com/program/?XHL585-5

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!

12/3/12 UPDATE: Nonki provided #1, #2, and #3 above: http://smallbasic.com/program/?XHL585-5

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.

 


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 all included applications 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-2013 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 TeamChallenge - Tower Defense Game

$
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, Cobra355, (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 turret graphics. Zock was the game designer, and Cobra had some gameplay input.

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 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

How to convert text into Binary

$
0
0

This fantastic chart comes from today's guest blogger, Liam McSherry.

In Liam's words...

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

 

If anyone wants to know how to convert text into a series of binary digits, I quickly made this little graphic.

 

Note that this sort of system applies to all radices as a way of converting to them, with the divisor "2" changed to the value of the radix.
 
This is on the topic of the blog article, Text to Binary Converter - Small Basic Featured Program.
 
Thanks to Liam for this cool diagram!
 
Enjoy!
 
   - Ninja Ed

Small Basic Program Gallery - Listed By Category

$
0
0

12/08/15 UPDATE: Oculus Rift Ball Bounce and Batting Practice (games), Database Sample and Wavelength to RGP Converter (Productivity), Clown: Parsed Pixels (Graphical), and Pendulum (Sciences). On 11/17/15: Small Block Builder and Triple Six (Games). On 10/21/15: Pendulum Clock 2 (Graphical). On 9/3/13: Eora Duck Hunt. On 8/31: Starfield Simulator 2 (Graphical). On 7/8: Walking Man (Graphical). On 6/29: Added SBCraft (Games). On 6/12: Added String Searcher. On 5/26: Added Basketball Science, Darts (Games), and Collision Physics (Sciences). 

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

In this gallery, the programs are divided by category, subcategory, and then alphabetically. Here are 121 of the best community-made Small Basic programs!

To Browse the programs listed only alphabetically, see Small Basic Program Gallery (alphabetical list). 

You should also come back later, because this list will evolve over time.

Index:

  • Games
    • Action
    • Cards & Dice
    • Exploration
    • Mazes
    • Shooters
    • Sports
    • Strategy/Puzzle
  • Graphical
    • Animated
    • Clocks
    • Drawings
    • Drawings with Input
    • Drawings with Messages
    • Interactive Visualizations
  • Math
    • Animated Algorithms
    • Converters
    • Fractals
    • Other Interactive
  • Productivity
    • Art/Drawing
    • Computer Apps
    • Map Based
    • Math Apps
    • Music/Sound
  • Sciences
    • Astronomy
    • Physics
  • Sound
  • Text
    • Animated
    • Ciphers
    • Interactive

   

Games

Action

Block Smasher V2 (info) by Behnam Azizi

Brick Wall (info) - by Stendec

Catch Game - by NaochanON

Click the Button - by Timo Sö

Darts - by NaochanON

Eurora Duck Hunt - by Jibba Jabba

Football Pong (P1 use S+D; P2 use K+L) - by Nonki Takahashi

Naochan Pong - by NaochanON

Oculus Rift: Ball Bounce (info) by Zock77

Stay Away from the Blue Ball - by Todd

Super Pong - by Litdev

Cards & Dice

Triple Six (info) - by Bluegrams

Exploration

Small Block Builder (info) - by Bluegrams

Mazes

3D Color RayCaster Maze - by Old Basic Coder

3D Maze - by Old Basic Coder

3D Maze (B&W) - by Pathdrc

Chomper (Packman) - by Anthony Yarrell/QBasicLover

Pacman Labyrinth - by LitDev

Smiley Maze - by Nik Coughlin

SnakeBite - by Davey Wavey

Snow Man Maze (Big) - by NaochanON

Snow Man Maze (Small) - by NaochanON

Star Catcher - by NaochanON

Turtle Maze (info) - by Nonki Takahashi

Shooters

1942 - by Laurent20

Alien Barrage (info) - by LitDev

Asteroids V2 - by Jason Jacques + Community

Invader Game - by NaochanON (play locally for proper framerate)

Invaders - by JKrueg

Soda Pop Showdown - by JKrueg

Space Invaders - by Davey Wavey 

Sports

Basketball - by NaochanON

Basketball Science - by Nonki Takahashi

Batting Practice - by Cody_M

Strategy/Puzzle

Chess Board - by Nonki Takahashi

Color Memory Game - by Martmen

Go Simulator - by Nonki Takahashi

Gorillas - by Rushworks

Minesweeper - by Nonki Takahashi

SBCraft - by Ardiezc Quazhulu

SokoCUTE - by kts99

TanCraft - by Behnam Azizi

Tankinator - by Zock77& Cobra355

Tetris - by Kenneth Kasajian

Tic Tac Toe (with menu) - by Nonki Takahashi

Tic Tac Toe (with tough AI) - by NaochanON

Tower of Hanoi - by Alex 2000

 

Graphical

Animated

Aquarium - by Nonki Takahashi

Blimp - by  Coding Cat

Christmas Tree with R2 - by Nonki Takahashi

Christmas Trees with Snow - by NaochanON

Fireworks - by NaochanON

Manta Rays Swimming - by NaochanON

Random Drawing - by Math Man& Coding Cat

Star Field Simulator - by JKrueg 

Starfield Simulator 2 - by Florian Auer

Swimming Shark (info) - by NaochanON

Tornado & Snow - by NaochanON

Walking Man - by NaochanON

Wave - by NaochanON

Whale Sharks - by NaochanON

Clocks

Analogue Clock (with wood texture) - by Math Man

Analogue Clock (no background) - by Nicolas_br 

Pendulum Clock - by Nonki Takahashi

Pendulum Clock 2 - by Kevin J

Pi Clock - by Math Man

Random Cat Clock - by NaochanON

Triangle Clock - by Nonki Takahashi

Water Clock - by NaochanON

Drawings

Ant - by NaochanON

Butterfly with Blue Wings - by NaochanON

Butterfly with Yellow Wings - by Math Man 

Clown: Parsed Pixels (info) - by Jibba Jabba

Crab - by NaochanON

Heart - Plump - by NaochanON

Heart - Regular - by Nonki Takahashi

Heart - Skinny - by Nonki Takahashi

Monarch Butterfly - by Nonki Takahashi

Drawings with Input

Heart Generator - by Math Man (run locally)

Pyramid - by NaochanON (be patient)

Drawings with Messages

Blimp - by  Coding Cat

Interactive Visualizations

Arrow - by Zock77

Atom - by Dudeson (follows mouse cursor)

Eyeballs - by Math Man 

Starfield Simulator - by Florian Auer

 

Math

Animated Algorithms

Sorting Algorithm Demo - by Zeven

Converters

Decimal to Binary Converter - by Amir CPS 

Number to Text - by Math Man

Text to Binary Converter - by Amir CPS

Fractals

Burning Ship Fractal - by Math Man

Julia Fractal - by Math Man

Mandelbrot Fractal - by Math Man

Mandelbrot Stripes Fractal - by Math Man

Mandelbrot Tricorn Fractal - by Math Man

Multibrot for D=3 - by Math Man

Multibrot for D=4  - by Math Man

Random Sierpinski Triangle - by RubikWizard

Sierpinski Triangle - by Stendec

Other Interactive

Happy Number Checker - by Math Man

  

Productivity

Art/Drawing

Blackboard - by Vijaye 

Color Picker - by Suduadib

Shapes (info) - by Nonki Takahashi

Wavelength to RGB Converter - by Pappa Lapub

Computer Apps

Code Block Generator v1.3 (info) - by Nonki Takahashi

Database Sample - by 

Installer (info) - by Timo Sö

String Searcher - by Jibba Jabba

Map Based

Weather (USA) - by NaochanON

Math Apps

Abacus - by Harry Hardjono

Abacus Beads - by Nonki Takahashi

Calculator - by  Alex 2000

Graph - by NaochanON

Nonki Calculator - by Nonki Takahashi

Ruler - by Nonki Takahashi

Music/Sound

Metronome - by NaochanON

Music Player (info) - by Amir CPS,NaochanON, and Absolu

Piano - by Nonki Takahashi (run locally)

 

Sciences

Astronomy

Moon Phases - by NaochanON 

Physics

Balance Scale - by NaochanON

Cargo Weight - by NaochanON

Collision Physics - by Litdev

Light Beam - by Math Man

Light Beam - Interactive - by Zock77 (press up and down to rotate the reflector)

Pendulum (info) - by Jibba Jabba

Spring - by NaochanON

 

Sound

Metronome - by NaochanON

Piano - by Nonki Takahashi (run locally)

 

Text

Animated

LED Display - by Amir CPS

Ciphers

Vigenère Cipher (info) - by Amir CPS (run locally)

Interactive

Silly Story Writer - by Talgon96 (run locally)

Text Writer - by Todd

 

This idea was inspired by Rene Miner in these comments.

Leave a comment with more programs to add. We'll need a name for the program, a category/subcategory it belongs in, a link to download/view it, and the name and profile link of the developer.

Thanks!

   - Ninja Ed

Small Basic E-Books

$
0
0

Learn more about Small Basic and find detailed samples by reading sample chapters from one of three e-books that we are providing to you at no cost. If you like using the e-book format, we have links on each page to where you can purchase the complete e-book.

 

The Developer's Reference Guide to Small Basic

Beginning Microsoft Small Basic

Basic Computer Games Small Basic Edition

 

We're starting with these three ebooks from Phil Conrod. Let me know if you've written a Small Basic book and would like it featured like this.

See the latest/updated version of this article (list of ebooks) here:

Small Basic E-Books

 

Enjoy!

   - Ninja Ed

Small Basic Curriculum

$
0
0

Learn all about Small Basic by using the curriculum. With the curriculum, you can lean Small Basic with separate lessons - just like you would in a classroom. You can download the curriculum, which includes PowerPoint decks to teach from. As a teacher or as a student learning Small Basic on your own, the curriculum will guide you step by step.

 

Use the curriculum online

Download the curriculum

Find international curriculum

 

Related Downloads

 

If you do not have Microsoft Office PowerPoint on your computer, you can view the curriculum by installing the Microsoft PowerPoint Viewer at no cost:

 

Other Small Basic Learning

 

See the latest/updated version of this article (list of curriculum) here:

Small Basic Curriculum

 

Enjoy!

   - Ninja Ed

Small Basic for Little Kids Series – Pong

$
0
0

 

It was a beautiful sunny weekend, and wife's mandate of father-son bonding was to be obeyed...  So, after a bike ride, it's time for some coding.  Small Basic, that is.

My little boy has been bugging me about game programming.  After some convincing, he settled on Pong, not entirely sure what Pong is.

Having in mind to post the process to the blog, we saved multiple versions of the code, so to show the progress.  I think he is still too young to understand version control :)

 

Version 1:

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make goals, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

'make ball
GraphicsWindow.FillEllipse(345,245,10,10)

'make paddles
GraphicsWindow.FillRectangle(30,220,10,60)
GraphicsWindow.FillRectangle(664,220,10,60)

 

He did most of the work himself for V1.

 

It's pretty straightforward.  The only question I had for him was why 700x500 for the graphic window.  Personally, I'd go with 800x600, or1024x768.  You know the whole VGA/SVGA thing :)

His reply was that he always use 700x500 for the graphics window.

One thing worth noting is that BrushColor and PenColor are for difference purposes.  The former for filling an object, the latter for drawing an object.

 

Version 2:

In V2, we added the wall for bouncing from left to right (X coordinates).  I gave him the idea that the illusion of a ball moving is achieved by repeatedly drawing and erasing a ball in a new position.

The speed of the ball movement can be adjusted by two factors:

Timer.interval and step size in moving in X direction.

The part of making the ball bounced off the wall seemed like a magic.  In reality it is nothing but flipping the corresponding step size (StepX) to the negative.

In fact, I made him to pretend to be a ball, and count out loud the steps, walk towards the wall, and "bouncing" off the wall.  After a couple times, he got it :)

 

' v2
' bounces well, left to right

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
GraphicsWindow.FillRectangle(30,220,10,60)
GraphicsWindow.FillRectangle(664,220,10,60)

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

' sleep
Timer.Interval = 1
Timer.Tick = RunGame

StepSize = 2

StepX = StepSize
StepY = 0

BallX=345
' BallY=245
BallY=100

LeftWallX = 27
RightWallX = 660

DrawBall()

Sub RunGame
  EraseBall()
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSize
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSize
  EndIf
 
  DrawBall() 
EndSub

 

Version 3:

 In V3, we handled bouncing the wall up and down.  This mirrors what's done in V2, except using StepX as opposed to StepY.  When put together, the ball can now bounces off all 4 walls (disregarding the goals and paddles).  It almost seemed magical.

 

' v3
' bounces well, left to right, and up and down.

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
GraphicsWindow.FillRectangle(30,220,10,60)
GraphicsWindow.FillRectangle(664,220,10,60)

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

' sleep
Timer.Interval = 1
Timer.Tick = RunGame

StepSizeX = 2
StepSizeY = 2

StepX = StepSizeX
StepY = StepSizeY

BallX=345
' BallY=245
BallY=100

' Edges of the 4 walls
LeftWallX = 27
RightWallX = 660
TopWallY = 27
BottomWallY = 460

DrawBall()

Sub RunGame
  EraseBall()
 
  ' Calculate the new position for ball
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSizeX
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSizeX
  EndIf

  ' Hit bottom wall
  If BallY >= BottomWallY Then
    StepY = -StepSizeY
  EndIf
 
  ' Hit top wall
  If BallY <= TopWallY Then
    StepY = StepSizeY
  EndIf

  DrawBall() 
EndSub

 

Version 4:

In V4, we took care of bouncing the ball of paddles.

 

' v3 - bounces well, left to right, and up and down.
' v4 - bounces off paddles

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
'GraphicsWindow.FillRectangle(30,220,10,60)
'GraphicsWindow.FillRectangle(664,220,10,60)

LeftPaddleX = 30
LeftPaddleY = 220

RightPaddleX = 664
RightPaddleY = 220

' draw left paddle
Sub DrawLeftPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' erase left paddle
Sub EraseLeftPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' draw right paddle
Sub DrawRightPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' erase right paddle
Sub EraseRightPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

'' hooking up events
Timer.Interval = 1
Timer.Tick = RunGame

StepSizeX = 2
StepSizeY = 2

StepX = StepSizeX
StepY = StepSizeY

BallX=345
' BallY=245
BallY=245

' Edges of the 4 walls
LeftWallX = 27
RightWallX = 660
TopWallY = 27
BottomWallY = 460

DrawBall()
DrawLeftPaddle()
DrawRightPaddle()

Sub RunGame
  EraseBall()
 
  ' Calculate the new position for ball
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSizeX
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSizeX
  EndIf

  ' Hit bottom wall
  If BallY >= BottomWallY Then
    StepY = -StepSizeY
  EndIf
 
  ' Hit top wall
  If BallY <= TopWallY Then
    StepY = StepSizeY
  EndIf
 
  ' Hit right paddle
  If (BallX >= RightPaddleX-12) And (BallY >= RightPaddleY) And (BallY <= RightPaddleY+60) Then
    StepX = -StepSizeX
    DrawRightPaddle()
  EndIf

  ' Hit left paddle
  If (BallX <= LeftPaddleX+12) And (BallY >= LeftPaddleY) And (BallY <= LeftPaddleY+60) Then
    StepX = StepSizeX
    DrawLeftPaddle()
  EndIf
 
  DrawBall() 
EndSub

 

Version 5:

In V5, we made the paddles movable.

The trick here is to add the events to handle key.  First we used KeyDown event.

For reasons I don't understand, the little fellow insisted that the left player should use "W" for up and "S" for down, while the right user uses Up Arrow for up, and Down Arrow for down.

During testing, I had this line added to event handler:

  GraphicsWindow.Title = "'" + LastKey + "' pressed"

 

That way, it's easier to tell which key was pressed (or released rather), and what's the corresponding value should be used in the code.

 

 

' v3 - bounces well, left to right, and up and down.
' v4 - bounces off paddles
' v5 - paddles can move

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
'GraphicsWindow.FillRectangle(30,220,10,60)
'GraphicsWindow.FillRectangle(664,220,10,60)

LeftPaddleX = 30
LeftPaddleY = 220

RightPaddleX = 664
RightPaddleY = 220

' draw left paddle
Sub DrawLeftPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' erase left paddle
Sub EraseLeftPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' draw right paddle
Sub DrawRightPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' erase right paddle
Sub EraseRightPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

'' hooking up events
Timer.Interval = 1
Timer.Tick = RunGame

GraphicsWindow.KeyDown = OnKeyDown

' handle key press, move paddles
Sub OnKeyDown
  LastKey = GraphicsWindow.LastKey
  GraphicsWindow.Title = "'" + LastKey + "' pressed"
  If (LastKey = "W") And (LeftPaddleY >= 31) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY - 10
    DrawLeftPaddle()
  ElseIf (LastKey = "S") And (LeftPaddleY <= 400) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY + 10
    DrawLeftPaddle()
    EndIf
  If (LastKey = "I") And (RightPaddleY >= 31) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY - 10
    DrawRightPaddle()
  ElseIf (LastKey = "K") And (RightPaddleY <= 400) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY + 10
    DrawRightPaddle()
  EndIf
 
EndSub

StepSizeX = 2
StepSizeY = 2

StepX = StepSizeX
StepY = StepSizeY

BallX=345
' BallY=245
BallY=245

' Edges of the 4 walls
LeftWallX = 27
RightWallX = 660
TopWallY = 27
BottomWallY = 460

DrawBall()
DrawLeftPaddle()
DrawRightPaddle()

Sub RunGame
  EraseBall()
 
  ' Calculate the new position for ball
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSizeX
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSizeX
  EndIf

  ' Hit bottom wall
  If BallY >= BottomWallY Then
    StepY = -StepSizeY
  EndIf
 
  ' Hit top wall
  If BallY <= TopWallY Then
    StepY = StepSizeY
  EndIf
 
  ' Hit right paddle
  If (BallX >= RightPaddleX-12) And (BallY >= RightPaddleY) And (BallY <= RightPaddleY+60) Then
    StepX = -StepSizeX
    DrawRightPaddle()
  EndIf

  ' Hit left paddle
  If (BallX <= LeftPaddleX+12) And (BallY >= LeftPaddleY) And (BallY <= LeftPaddleY+60) Then
    StepX = StepSizeX
    DrawLeftPaddle()
  EndIf
 
  DrawBall() 
EndSub

 

Version 6:

In V6, we solved the two-player problem.

 

We found it to be problematic, when both players try to hold the key down at the same time.  The program can only respond to one.

I had the idea of instead to handle KeyUp event.  That way it will force players to hit the keys instead of holding the keys down and don't let it go.

 

' v3 - bounces well, left to right, and up and down.
' v4 - bounces off paddles
'v5 - paddles can move
'v6 - change from KeyDown to KeyUp for two-player mode

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
'GraphicsWindow.FillRectangle(30,220,10,60)
'GraphicsWindow.FillRectangle(664,220,10,60)

LeftPaddleX = 30
LeftPaddleY = 220

RightPaddleX = 664
RightPaddleY = 220

' draw left paddle
Sub DrawLeftPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' erase left paddle
Sub EraseLeftPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' draw right paddle
Sub DrawRightPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' erase right paddle
Sub EraseRightPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

'' hooking up events
Timer.Interval = 1
Timer.Tick = RunGame

GraphicsWindow.KeyUp = OnKeyUp

' handle key press, move paddles
Sub OnKeyUp
  LastKey = GraphicsWindow.LastKey
  GraphicsWindow.Title = "'" + LastKey + "' pressed"
  If (LastKey = "W") And (LeftPaddleY >= 31) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY - 10
    DrawLeftPaddle()
  ElseIf (LastKey = "S") And (LeftPaddleY <= 400) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY + 10
    DrawLeftPaddle()
    EndIf
  If (LastKey = "Up") And (RightPaddleY >= 31) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY - 10
    DrawRightPaddle()
  ElseIf (LastKey = "Down") And (RightPaddleY <= 400) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY + 10
    DrawRightPaddle()
  EndIf
 
EndSub

StepSizeX = 2
StepSizeY = 2

StepX = StepSizeX
StepY = StepSizeY

BallX=345
' BallY=245
BallY=245

' Edges of the 4 walls
LeftWallX = 27
RightWallX = 660
TopWallY = 27
BottomWallY = 460

DrawBall()
DrawLeftPaddle()
DrawRightPaddle()

Sub RunGame
  EraseBall()
 
  ' Calculate the new position for ball
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSizeX
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSizeX
  EndIf

  ' Hit bottom wall
  If BallY >= BottomWallY Then
    StepY = -StepSizeY
  EndIf
 
  ' Hit top wall
  If BallY <= TopWallY Then
    StepY = StepSizeY
  EndIf
 
  ' Hit right paddle
  If (BallX >= RightPaddleX-12) And (BallY >= RightPaddleY) And (BallY <= RightPaddleY+60) Then
    StepX = -StepSizeX
    DrawRightPaddle()
  EndIf

  ' Hit left paddle
  If (BallX <= LeftPaddleX+12) And (BallY >= LeftPaddleY) And (BallY <= LeftPaddleY+60) Then
    StepX = StepSizeX
    DrawLeftPaddle()
  EndIf
 
  DrawBall() 
EndSub

 

Version 7:

Finally, in V7, we added additional code to count scores and see who is the winner.

 

' v3 - bounces well, left to right, and up and down.
' v4 - bounces off paddles
' v5 - paddles can move
' v6 - change from KeyDown to KeyUp for two-player mode
' v7 - count scores

' make background
GraphicsWindow.Width = "700"
GraphicsWindow.Height = "500"

'set pen
GraphicsWindow.PenColor = "gray"
GraphicsWindow.PenWidth = "50"

'draw border
GraphicsWindow.DrawRectangle(0,0,700,500)

' set brush
GraphicsWindow.BrushColor = "white"

' make left goal, size 100, from (0,200) to (0,300)
GraphicsWindow.FillRectangle(0,200,26,100)

' make right goal, size 100, from (674,200) to (674,300)
GraphicsWindow.FillRectangle(674,200,26,100)

' set brush
GraphicsWindow.BrushColor = "black"

' make paddles
'GraphicsWindow.FillRectangle(30,220,10,60)
'GraphicsWindow.FillRectangle(664,220,10,60)

LeftPaddleX = 30
LeftPaddleY = 220

RightPaddleX = 664
RightPaddleY = 220

' draw left paddle
Sub DrawLeftPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' erase left paddle
Sub EraseLeftPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(LeftPaddleX,LeftPaddleY,10,60)
EndSub

' draw right paddle
Sub DrawRightPaddle
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' erase right paddle
Sub EraseRightPaddle
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillRectangle(RightPaddleX,RightPaddleY,10,60)
EndSub

' draw ball
Sub DrawBall
  GraphicsWindow.BrushColor = "black"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
EndSub

' erase ball
Sub EraseBall
  GraphicsWindow.PenWidth = "2"
  GraphicsWindow.BrushColor = "white"
  GraphicsWindow.FillEllipse(BallX,BallY,10,10)
  GraphicsWindow.PenColor = "white"
  GraphicsWindow.DrawEllipse(BallX,BallY,10,10)
EndSub

'' hooking up events
Timer.Interval = 1
Timer.Tick = RunGame

GraphicsWindow.KeyUp = OnKeyUp

' handle key press, move paddles
Sub OnKeyUp
  LastKey = GraphicsWindow.LastKey
  ' GraphicsWindow.Title = "'" + LastKey + "' pressed"
  If (LastKey = "W") And (LeftPaddleY >= 31) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY - 10
    DrawLeftPaddle()
  ElseIf (LastKey = "S") And (LeftPaddleY <= 400) Then
    EraseLeftPaddle()
    LeftPaddleY = LeftPaddleY + 10
    DrawLeftPaddle()
    EndIf
  If (LastKey = "Up") And (RightPaddleY >= 31) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY - 10
    DrawRightPaddle()
  ElseIf (LastKey = "Down") And (RightPaddleY <= 400) Then
    EraseRightPaddle()
    RightPaddleY = RightPaddleY + 10
    DrawRightPaddle()
  EndIf
 
EndSub

StepSizeX = 2
StepSizeY = 2

StepX = StepSizeX
StepY = StepSizeY

' initial ball position
Sub SetBallToMiddle
  BallX=345
  BallY=245
EndSub

' Edges of the 4 walls
LeftWallX = 27
RightWallX = 660
TopWallY = 27
BottomWallY = 460

SetBallToMiddle()
DrawBall()
DrawLeftPaddle()
DrawRightPaddle()

GraphicsWindow.Title = "Pong"

' begin scores
leftscore = Controls.AddTextBox(5,1)
rightscore = Controls.AddTextBox(531,1)
mesgboard = Controls.AddTextBox(265,1)

leftscorecount = 0
rightscorecount = 0

Controls.SetTextBoxText(leftscore, leftscorecount)
Controls.SetTextBoxText(rightscore, rightscorecount)

Sub RunGame
  EraseBall()
 
  ' Calculate the new position for ball
  BallX = BallX + StepX
  BallY = BallY + StepY
 
  ' Hit right wall
  If BallX >= RightWallX Then
    StepX = -StepSizeX
  EndIf
 
  ' Hit left wall
  If BallX <= LeftWallX Then
    StepX = StepSizeX
  EndIf

  ' Hit bottom wall
  If BallY >= BottomWallY Then
    StepY = -StepSizeY
  EndIf
 
  ' Hit top wall
  If BallY <= TopWallY Then
    StepY = StepSizeY
  EndIf
 
  ' Hit right paddle
  If (BallX >= RightPaddleX-12) And (BallY >= RightPaddleY) And (BallY <= RightPaddleY+60) Then
    StepX = -StepSizeX
    DrawRightPaddle()
  EndIf

  ' Hit left paddle
  If (BallX <= LeftPaddleX+12) And (BallY >= LeftPaddleY) And (BallY <= LeftPaddleY+60) Then
    StepX = StepSizeX
    DrawLeftPaddle()
  EndIf
 
  ' Hit right goal
  If (BallX >= RightWallX) And (BallY > 200) And (BallY < 300) Then
    SetBallToMiddle()
    DrawBall()
    GraphicsWindow.Title = "Left player scored"
    leftscorecount = leftscorecount + 1
    Controls.SetTextBoxText(leftscore, leftscorecount)
  EndIf
 
  ' Hit left goal
  If (BallX <= LeftWallX) And (BallY > 200) And (BallY < 300) Then
    SetBallToMiddle()
    DrawBall()
    GraphicsWindow.Title = "Right player scored"
    rightscorecount = rightscorecount + 1
    Controls.SetTextBoxText(rightscore, rightscorecount)

  EndIf

  DrawBall() 

  ' check who won
  If leftscorecount >= 3 Then
    Controls.SetTextBoxText(mesgboard, "Left side WON!!!")
    TheEnd()
  EndIf

  If rightscorecount >= 3 Then
    Controls.SetTextBoxText(mesgboard, "Right side WON!!!")
    TheEnd()
  EndIf
   
EndSub

' End the game
Sub TheEnd
  SetBallToMiddle()
  StepSizeX = 0
  StepSizeY = 0
EndSub

 

 

We did all this in about 2 hours, on and off.  You know kids attention span is short :)

 

But the way we did it so that at each iteration something is accomplished was very helpful.  I guess you could call that Agile development, another concept I will withhold from him for now :)

 

We hit a bit of unnecessary complications that I should have thought of to avoid.  That is, the width of all objects, including the border, the paddles, and balls.

So, a couple times we will have to erase more than what's drawn.  Also, the rendering of animation is not as smooth as we would like.  The little one is actually not too surprised.  He calls them glitches.  Guess got used to from video games.

Overall, it was a good experience for a lazy Sunday afternoon.  Priceless :)

 


Small Basic Game Gallery

$
0
0

This is an exhaustive list of the Small Basic games coming from our community of developers!

 

Small Basic Games

Action

Basketball - by NaochanON

Basketball Science - by Nonki Takahashi

Block Smasher V2 (info) by Behnam Azizi

Brick Wall (info) - by Stendec

Catch Game - by NaochanON

Click the Button - by Timo Sö

Darts - by NaochanON

Football Pong (P1 use S+D; P2 use K+L) - by Nonki Takahashi

Naochan Pong - by NaochanON

Stay Away from the Blue Ball - by Todd

Super Pong - by Litdev

Mazes

3D Color RayCaster Maze - by Old Basic Coder

3D Maze - by Old Basic Coder

3D Maze (B&W) - by Pathdrc

Chomper (Packman) - by Anthony Yarrell/QBasicLover

Pacman Labyrinth - by LitDev

Smiley Maze - by Nik Coughlin

SnakeBite - by Davey Wavey

Snow Man Maze (Big) - by NaochanON

Snow Man Maze (Small) - by NaochanON

Star Catcher - by NaochanON

Turtle Maze (info) - by Nonki Takahashi

Shooters

1942 - by Laurent20

Alien Barrage (info) - by LitDev

Asteroids V2 - by Jason Jacques + Community

Invader Game - by NaochanON (play locally for proper framerate)

Invaders - by JKrueg

Soda Pop Showdown - by JKrueg

Space Invaders - by Davey Wavey

Strategy/Puzzle

Chess Board - by Nonki Takahashi

Color Memory Game - by Martmen

Go Simulator - by Nonki Takahashi

Gorillas - by Rushworks

Minesweeper - by Nonki Takahashi

SBCraft - by Ardiezc Quazhulu

SokoCUTE - by kts99

TanCraft - by Behnam Azizi

Tankinator - by Zock77& Cobra355

Tetris - by Kenneth Kasajian

Tic Tac Toe (with menu) - by Nonki Takahashi

Tic Tac Toe (with tough AI) - by NaochanON

Tower of Hanoi - by Alex 2000

Eora Duck Hunt - Small Basic Featured Game

$
0
0

New game in Jibba Jabba's words:

 

It only runs locally, NOT in the browser. You can import using id  XCC705-1

Or here's the browser link for a quick look, but it won't run in the browser:  http://smallbasic.com/program/?XCC705-1

It's called Eora Duck Hunt because that's the Australian Aboriginal language group I belong to. It also shares an important part of our Lore in regard to hunting. The game gui also has 3 circles drawn it. This is a sacred map that belongs to me, my family and the "Dreamers" and some elders. The map can only be understood by a few people this is because you can only gain access to this knowledge by traditional rites of passage, i.e. boys to men. To speak of these things would be the equivalent  of doing a child's homework for them and depriving them of their rite to an independent and unindoctrinated adult life. They have to do it themselves.

The red line represents the Great Snake.

I hope to post future games I write on indigenous websites whereby the games communicate important traditional knowledge to kids that it maybe relevant and vital to. The songlines were and still are our internet. But this is something new.

Here's a link to what I'm talking about: http://www.turtleisland.org/culture/computersports.htm  

Thanks for the opportunity to share

 

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

 

And thank you, Jibba Jabba, for this fantastic game!

   - Ninja Ed

Small Basic is FREE!!!

$
0
0

Yeah, it's free. Give yourself a gift. Or give a kid a future in computer software that they might not otherwise have. Just click:

What is Small Basic? Well... Small Basic is Fun, Simple, Social, & Gradual.

And these resources will guide you. Ten year olds have used these resources on their own to learn Small Basic:

 

Maybe you want to see what people have been doing with it first...


Small Basic Program Gallery (listed by Category)

Small Basic Extension Gallery

Small Basic Student Testimonies - 47 students, from age 8-13, explain how easily they learned Small Basic and how great it is.

 

Maybe you're ready to engage with the community...

   Small Basic Forum

   Small Basic on TechNet Wiki (all articles)

   Small Basic Site

  

Enjoy! 

   - Ninja Ed

Tap into Small Basic Forum

$
0
0

When you are learning Small Basic programming, you may stack on your debugging.  I recommend to utilize lots of resources about Small Basic as following steps.

  1. Search in TechNet Wiki.  Small Basic Portal may help you.
  2. Search in Small Basic Forum.
  3. Ask question in Small Basic Forum.
To search in Small Basic Forum, (1) use search box with keywords.  If other category posts are appeared, (2) select Small Basic Forum.
When you ask in Small Basic Forum, please read PLEASE READ BEFORE POSTING.

 You will get the best help if you provide enough information for someone to understand what it is you want help with and reproduce the problem easily - if they have to guess it can be frustrating from both sides.  This often involves you working on a problem for a little bit first, then narrowing down the problem you are having to a small example (if possible).  Then post the example code you are working on (or PUBLISH the ID) along with a clear description of what you expect to happen and what doesn't work.

source: "Asking a good question" section in PLEASE READ BEFORE POSTING 

Vector Sample in Small Basic

Viewing all 218 articles
Browse latest View live


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