Small Basic

Small Basic
Microsoft Small Basic
Sb logo.png
Eine kostenlose und einfache BASIC-Entwicklungsumgebung
Basisdaten
Paradigmen: prozedural
Erscheinungsjahr: 2008
Entwickler: Microsoft
Aktuelle Version: 1.0  (12. Juli 2011)
Betriebssystem: Microsoft Windows
Lizenz: proprietär
www.smallbasic.com

Small Basic (nicht zu verwechseln mit SmallBASIC, einem anderen, betagteren BASIC-Derivat) ist eine moderne, sehr vereinfachte und vordergründig für Programmiereinsteiger geschaffene kostenlose BASIC-Entwicklungsumgebung. Mit Small Basic wird das Ziel verfolgt, durch schnell erlebbare Erfolge die Lernmotivation und Experimentierfreudigkeit bei Programmieranfängern zu wecken.

Der Anwendungssektor von Small Basic erstreckt sich jedoch nicht nur auf das eben erwähnte Lernumfeld, auch für den versierteren "Heim-Programmierer" kann Small Basic unter Umständen ein praktischer Alltagshelfer sein, da durch die Verwendung externer Bibliotheken der Funktionsumfang deutlich erweitert werden kann.

Die Entwicklungsumgebung, die begleitende benutzerfreundliche Einsteigerdokumentation sowie Lehrpläne stehen in zahlreichen Sprachen (u. a. auch in Deutsch) zur Verfügung.

Inhaltsverzeichnis

Geschichte

Erste Pre-Releases von Small Basic wurden 2008/09 vom damaligen Microsoft-Entwickler Vijaye Raji erstellt und veröffentlicht. Spätere Pre-Releases wurden dann im Rahmen des DevLabs-Projekt von Microsoft betreut und publiziert. Im Juli 2011 veröffentlichte Microsoft mit Version 1.0 die erste finale Version von Small Basic.

Aktuelle Version

1.0 (veröffentlicht am 12. Juli 2011)

Sprache

Small Basic unterstützt die imperative Programmierung. Auf die objektorientierte Programmierung wurde bewusst verzichtet.

Eine überschaubare Zahl von jedoch recht mächtigen Schlüsselwörtern erstreckt sich über zahlreiche Anwendungsgebiete und ermöglicht das Erzeugen einfacher Anwendungen und Spiele, welche in einem Text- oder Grafikfenster laufen können.

Syntaxbeispiele

Textfenster

TextWindow.WriteLine("Hallo Welt!")

Grafikfenster

GraphicsWindow.DrawBoundText(10,30,500,"Hallo Welt!")

Programmbeispiel Konsolenspiel

  Mouse.HideCursor()
  Balltyp = File.ReadContents("C:\Users\PepeGiallo\Documents\Für Programm\Balltyp")
  If Balltyp = "0" Then
    Balltyp = Math.GetRandomNumber(5)
    Balltyp = Balltyp * 1000
  Else
    Goto begin
  EndIf
  Score = File.ReadContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball")
  If Score > 1 Then
    Goto begin
    Else
    File.WriteContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball", 0)
  EndIf
 
begin:
 
  File.WriteContents("C:\Users\PepeGiallo\Documents\Für Programm\Balltyp", Balltyp)
  Balltyp = File.ReadContents("C:\Users\PepeGiallo\Documents\Für Programm\Balltyp")
  GraphicsWindow.FontSize = 20
  GraphicsWindow.FontName = "Arial"
  Score = File.ReadContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball")
  GraphicsWindow.BrushColor = "Blue"
  GraphicsWindow.DrawText(10, 10, "Score: " + Score)
  GraphicsWindow.BackgroundColor = "White"
  GraphicsWindow.BrushColor = "#32CD32"
  paddle = Shapes.AddRectangle(120, 15)
  If Score = Balltyp Then
    Balltyp = Balltyp + 5000
    GraphicsWindow.BrushColor = "Red"
    ballwiedererk = "Red"
  Else
    ballwiedererk = "Green"
  EndIf
  ball = Shapes.AddEllipse(20, 20)
  'Wenn etwas mit den roten bällen nicht stimmt => Aktiviere untere Zeile zum nachschauen
  'GraphicsWindow.DrawText(300, 10, Balltyp)
  GraphicsWindow.MouseMove = OnMouseMove
  Shapes.ShowShape(ball)
  Startposition = Math.GetRandomNumber(603)
  Shapes.Move(ball, Startposition, 0)
  x = Startposition
  y = 0
  WinkelX = Math.GetRandomNumber(2)
  WinkelY = Math.GetRandomNumber(2)
  deltaX = WinkelX
  deltaY = WinkelY
 
RunLoop:
 
  x = x + deltaX
  y = y + deltaY
  gw = GraphicsWindow.Width
  gh = GraphicsWindow.Height
  If (x >= gw - 20 or x <= 0) Then
    deltaX = -deltaX
  EndIf
  If (y <= 0) Then
    deltaY = -deltaY
  EndIf
  padX = Shapes.GetLeft (paddle)
  If (y = gh - 28 and x >= padX and x <= padX + 120) Then
    deltaY = -deltaY
    If ballwiedererk = "Red" Then
      Score = Score - 2000
      Balltyp = Balltyp + 5000
    EndIf
    If ballwiedererk = "Green" Then
      Score = Score + 1000
    EndIf
    Shapes.HideShape(ball)
    File.WriteContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball", Score)
    GraphicsWindow.Clear()
    Goto begin
  EndIf
  Shapes.Move(ball, x, y)
 
 
'Verzögerung
  If Score = 0 Then
    Program.Delay(5)
  EndIf
  If Score < 20000 Then
    Program.Delay(4)
  EndIf
  If Score < 60000 Then
    Program.Delay(3)
  EndIf
  If Score < 100000 Then
    Program.Delay(2)
  EndIf
  If Score >= 100001 Then
    Program.Delay(1)
  EndIf
'Verzögerung Ende
  If (y < gh) Then
    Goto RunLoop
  EndIf
  GraphicsWindow.Clear()
  If ballwiedererk = "Red" Then
    Score = Score + 2000
    Balltyp = Balltyp + 5000
    Goto begin
  EndIf
  GraphicsWindow.BrushColor = "#32CD32"
  GraphicsWindow.FontSize = 81
  GraphicsWindow.DrawText(50, 50, "Your Score is")
  GraphicsWindow.BrushColor = "Blue"
  Score = File.ReadContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball")
  GraphicsWindow.FontSize = 100
  GraphicsWindow.DrawText(50, 200, Score)
  File.WriteContents("C:\Users\PepeGiallo\Documents\Für Programm\Score_Berndi_Ball", 0)
  File.WriteContents("C:\Users\PepeGiallo\Documents\Für Programm\Balltyp", 0)
  Sub OnMouseMove
    paddleX = GraphicsWindow.MouseX
    Shapes.Move(paddle, paddleX - 60, GraphicsWindow.Height - 12)
  EndSub
 
  Program.Delay(5000)
  GraphicsWindow.Clear()
  Goto begin

Programmierbeispiel (Sinnloser Knopf)

  GraphicsWindow.Show()
  GraphicsWindow.Title = "Sinnloser Knopf WARNUNG SINNLOS"
  GraphicsWindow.BackgroundColor = "Black"
  GraphicsWindow.Width = 800
  GraphicsWindow.Height = 600
  GraphicsWindow.FillRectangle(400, 300, 50, 50)
  GraphicsWindow.MouseDown = OnMouseDown
Sub OnMouseDown
  x = GraphicsWindow.MouseX
  y = GraphicsWindow.MouseY
  If(x >399 And x <451 And y > 299 And y < 351) Then
    GraphicsWindow.ShowMessage("Du hast den sinnlosen Knopf betätigt!", "Sinnloser Knopf")
  EndIf
EndSub

Besonderheiten

IDE von Small Basic
Ein mit Small Basic erstelltes Programm
  • Befehle und ihre Ereignisse, Methoden und Eigenschaften werden im Editor komfortabel mittels "IntelliSense(TM)" vervollständigt.
  • Datentypen werden vollautomatisch (und unsichtbar) zugeordnet und verwaltet.
  • Für Small Basic geschriebener Code kann auf Knopfdruck zu in VB.NET weiter verarbeitbaren Code umgewandelt werden.
  • Optional besteht die Möglichkeit, einen selbst erzeugten Quelltext auf einer speziellen Small-Basic-Seite zu veröffentlichen. Sofern clientseitig Microsoft Silverlight installiert ist, kann dieses Programm dann in den meisten Fällen auch auf jener Seite online ausgeführt und sogar in andere Webseiten eingebettet werden.
  • Mit Hilfe anderer .NET-Sprachen (VB.NET, C#, ...) können funktionserweiternde Bibliotheken für Small Basic erstellt werden.

Voraussetzungen

Für die Verwendung der Entwicklungsumgebung von Small Basic und zur Nutzung einer damit erzeugten EXE wird Microsoft Windows und die .NET-Laufzeitumgebung der Version 3.5 benötigt.

Literatur

  • Hans-Georg Schumann: Small Basic für Kids. mitp-Verlag, Neuerscheinung Ende August 2011, ISBN: 3826681886.

Weblinks


Wikimedia Foundation.

Игры ⚽ Нужна курсовая?

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Microsoft Small Basic — This article is about the Microsoft programming language. For the GPL programming language, see SmallBASIC. Microsoft Small Basic Small Basic running on Windows 7 Original author(s) Microsoft DevLabs …   Wikipedia

  • Microsoft Small Basic — Microsoft Small Basic …   Википедия

  • Microsoft Small Basic — Apparu en 2008 Auteur Microsoft DevLabs Dialectes Microsoft Small Basic 0.4 (Avril 2009) Influencé par …   Wikipédia en Français

  • BASIC — Класс языка: алгоритмическое, процедурное, объектное программирование Появился в: 1963 г. Расширение файлов: .bas Типизация данных: нестрогая Бейсик (от BASIC, сокращение от англ.  …   Википедия

  • BASIC-256 — с …   Википедия

  • BASIC — This article is about the programming language. For the think tank, see British American Security Information Council. For the group of countries, see BASIC countries. For other uses, see Basic (disambiguation). BASIC Screenshot of Atari BASIC,… …   Wikipedia

  • small arm — small armed, adj. Usually, small arms. a firearm designed to be held in one or both hands while being fired: in the U.S. the term is applied to weapons of a caliber of up to one in. (2.5 cm). [1680 90] * * * ▪ military technology Introduction… …   Universalium

  • Basic English — Basic English, also known as Simple English, is an English based controlled language created (in essence as a simplified subset of English) by linguist and philosopher Charles Kay Ogden as an international auxiliary language, and as an aid for… …   Wikipedia

  • Small-cell carcinoma — Classification and external resources Micrograph of a small cell carcinoma of the lung showing cells with nuclear moulding, minimal amount of cytoplasm and stippled chromatin. FNA specim …   Wikipedia

  • BASIC Programming — was released for the Atari 2600 console in 1979. One of only a few non gaming cartridges, this program allowed consumers to create some simple programs using its own unique programming language, which was superficially similar to dialects of… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”