Questions tagged [smallbasic]

Small Basic is a Microsoft product for teaching beginners to program.

Small Basic is a Microsoft product for teaching beginners to program.

78 questions
10
votes
3 answers

Find an integer n > 0 which holds the following three conditions

Some definition for starters: flip(n) is the 180 degree rotation of a seven segment display font number, so a 2 in seven segment font will be flipped to a 2. 0,1,2,5,8 will be mapped to themselfs. 6 -> 9, 9 -> 6 and 3,4,7 are not defined. Therefore…
pintxo
  • 2,085
  • 14
  • 27
3
votes
1 answer

I'm currently trying to learn commodore 64 BASIC and I'm getting an error with my sleep function

I've been recently learning commodore 64 BASIC and I'm trying to create a text adventure game, and I'm getting an error concerning all of the sleep functions I used. My code is: 20 SLEEP(1000) 30 PRINT CLS 40 INPUT "START SURVEY?" ANSWER$ 50 IF…
3
votes
2 answers

Is there a way to comment out blocks of code?

I recently got an assignment where I volunteer to teach kids a basic programming language. I chose Small Basic, as it's relatively easy to learn and teaches the basics of programs (if, for and while). I haven't used it much before (I learned how to…
The Flubbs
  • 57
  • 1
  • 8
2
votes
1 answer

How do I get more than one keyboard input at a time in Small Basic

I thought this would work, but didn't GraphicsWindow.KeyDown = KeyDown Sub KeyDown If GraphicsWindow.LastKey = "W" And GraphicsWindow.LastKey = "Space" Then Do Stuff EndIf EndSub I need a solution to this so I can get more than one…
Auxhil
  • 21
  • 3
2
votes
2 answers

Recursion using only global variables

For the cause of simplicity, Smallbasic has only global variables. It does not have locals or parameters. Although this makes it simpler to teach or learn it, it also complicates some matters, like recursive functions. I had a hard time creating a…
Mousa
  • 2,190
  • 3
  • 21
  • 34
2
votes
3 answers

Small basic random letters

I'm batch file programmer but I'm experimenting with Small Basic. I know how to generate random numbers as a variable: Math.getrandomnumber(number) but I'm not sure how to generate random letters
Tristan
  • 27
  • 6
1
vote
1 answer

Small basic turtle MoveTo error "Value was either too large or too small for a Decimal."

This code appears to throw an exception "Value was either too large or too small for a Decimal." Somehow changing variables y1, y2, x removes an error. For example, y2 from 41 to 38. How can I fix this? Turtle.Speed = 10 x = 10 y1 = 42 y2 =…
1
vote
2 answers

Basic: Why is the result different than the value in this For loop?

For num = 100 To 5 Step -5 TextWindow.WriteLine(num) EndFor The final value for this code that is displayed in the console is 5. However, when using the 'num' variable outside of the For loop, the value of 'num' results in 0. Why is…
Matthias
  • 35
  • 4
1
vote
1 answer

What is a rule for converting an array into a string in Small Basic?

What is a rule for converting an array into a string in Small Basic? b[0] = "b0" b[2] = 1 a[0][0] = "a" a[0][1] = 123 a[1][2] = "True" a[1][3] = b TextWindow.WriteLine(a) '0=0\=a\;1\=123\;;1=2\=True\;3\=0\\\=b0\\\;2\\\=1\\\;\;; c[0][0][0] =…
김가영
  • 11
  • 2
1
vote
1 answer

Small Basic new line code

The problem is: Whenever you type in 2 numbers, as required, the results are lined one after another, what creates an image of a huge number. Does anyone know a code/command to separate the results of arithmetic operations into rows? Thank you…
Cyber Bot
  • 11
  • 4
1
vote
3 answers

How can I get a random multiple of 50 using Microsoft Small Basic?

How can I get a random multiple of 50 between 0 and 800? So I would need numbers: 0,50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800. I've tried using math.getrandomnumber(800) but that gives me any number.
1
vote
1 answer

Small Basic random colored objects order themselves?

I'm trying to give my Small Basic program a random background: If File.ReadContents(Program.Directory + "\Turtle.settings") = "" Then Reset() EndIf Background = File.ReadLine(Program.Directory + "\Turtle.settings", 1) Color =…
Jaïr Paalman
  • 268
  • 1
  • 3
  • 12
1
vote
1 answer

After I have used my subroutine 2 - 4 times. A message saying "Press any key to continue..."

I am using Small Basic, and I am rather new to programming. Here are my subroutines: Sub MoneyClasses If CurrentJob = "Cleaner" Then Money = Money + 1 ElseIf CurrentJob = "Farmer" Then Money = Money + 3 ElseIf CurrentJob…
noaho
  • 19
  • 2
1
vote
1 answer

if statements weird behavior

I was caught playing Slither during class. My punishment was to program the game in small basic. I now have a row of balls and if the first ball rolls over the small dots. The dots will disappear and you will gain a point. The if statements that…
Tristan
  • 2,000
  • 17
  • 32
1
vote
4 answers

SmallBASIC player controller

I just started working on SmallBASIC, and I've figured I can make a simple player controller by using a changeable variable which determines the amount of pixels the object is across the graphics window. This is what I've done: tutle =…
Shabby Cat
  • 31
  • 5
1
2 3 4 5 6