- Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
152 lines (152 loc) · 9.89 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible" content="IE=edge">
<metaname="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | one more basic</title>
<metaname="description" content="SmallBASIC | One more basic">
<linkrel="canonical" href="/index.html">
<linkrel="keywords" href="index">
<linkrel="stylesheet" href="/css/style.css">
<linkrel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<scriptsrc="/clipboard.js"></script>
</head>
<body>
<buttononclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<scriptsrc="/backtotop.js"></script>
<divclass="wrapAll clearfix">
<navclass="navigation">
<divclass="logo">
<ahref="/"><imgsrc='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<divclass="navlinks">
<ahref="/pages/download.html">Download</a>
<ahref="/pages/news.html">News</a>
<ahref="/pages/community.html">Community</a>
<ahref="/pages/articles.html">Resources</a>
<ahref="/pages/reference.html">Language Reference</a>
<ahref="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<divclass="mainsection">
<divclass="tabs clearfix">
<divclass="tabsRight">
<atarget="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/index.markdown">Edit</a>
<atarget="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/index.markdown">History</a>
</div>
</div>
<divclass="article">
<h1id="smallbasic">SmallBASIC</h1>
<blockquote>
<p>SmallBASIC is a fast and easy to learn BASIC language interpreter
ideal for everyday calculations, scripts and prototypes. SmallBASIC
includes trigonometric, matrices and algebra functions, a built in IDE,
a powerful string library, system, sound, graphic commands and
communication via serial or sockets along with structured programming
syntax.</p>
</blockquote>
<p><imgsrc="../images/sb-logo_text.png"
style="display: block; margin-left: auto; margin-right: auto; padding-top:2em; padding-bottom:2em;" /></p>
<p><ahref="pages/download.html" class="LinkIndexPage">Download</a><a
href="https://smallbasic.github.io/online/sbasic.html"
class="LinkIndexPage">Try online</a></p>
<h2id="programming-made-easy-for-all">Programming Made Easy for
All</h2>
<p>SmallBASIC is available for various operating systems, including
Windows, Linux, and Android. You can even build it from source to run on
many other POSIX-compliant systems, such as Raspberry Pi OS for the
Raspberry Pi. With its built-in Integrated Development Environment
(IDE), you can write programs on your Android-powered tablet or mobile
phone and run them instantly.</p>
<p><imgsrc="../images/os_logos_devices.png"
style="display: block; margin-left: auto; margin-right: auto; padding-top:1em; padding-bottom:1em;" /></p>
<p><ahref="pages/screenshots.html"
class="LinkIndexPage">Screenshots</a></p>
<p>SmallBASIC makes it easy to bundle your program with all the
necessary libraries, creating executable files for Windows (exe-files)
or Linux (AppImage). For Android, you can create a signed package (pkg)
and distribute it through platforms like Google Play. Learn more about
distributing your program on our (<a
href="/pages/distributiontool.html">Distribution</a>) page.</p>
<p>If you prefer an online experience, you can start programming with
the web-based version of SmallBASIC in your browser right now. Just
click on <ahref="/online/sbasic.html">Start online</a> to begin
coding.</p>
<h2id="editors-ide-and-smallbasic-versions">Editors, IDE and SmallBASIC
versions</h2>
<p>SmallBASIC comes in three different flavors for the desktop. The SDL
version offers a simple but efficient IDE and is perfect for working
with graphics. The FLTK version has a great IDE. The console version
doesn’t offer an IDE and is text-only but works perfect with plugins
like raylib or nuklear (<a
href="/pages/download.html">Downloads</a>).</p>
<p><imgsrc="../images/sb_versions.png"
style="display: block; margin-left: auto; margin-right: auto; padding-top:1em; padding-bottom:1em;" /></p>
<p>No matter which SmallBASIC version you prefer, external editors like
Visual Studio Code, Geany, Sublime Text or KDE Kate can be setup for
syntax highlighting or code execution (<a
href="/pages/language_support.html">Setup external editors</a>).</p>
<p>Instructions on how to use the editor in the SDL and Android version
can be found in the article <a
href="/pages/android.html">Android</a></p>
<h2id="units">Units</h2>
<p>Units are sets of functions, procedures and constants bundled in a
BASIC-library and can be imported in your program. Units use their own
namespace and therefore are separated from your program.</p>
<divclass="sourceCode" id="cb1"><pre
class="sourceCode smallbasic"><codeclass="sourceCode smallbasic"><spanid="cb1-1"><ahref="#cb1-1" aria-hidden="true" tabindex="-1"></a><spanclass="co">' Example for importing the CSS color-name unit</span></span>
<spanid="cb1-2"><ahref="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb1-3"><ahref="#cb1-3" aria-hidden="true" tabindex="-1"></a><spanclass="pp">Import</span> crgb <spanclass="kw">as</span> c</span>
<spanid="cb1-4"><ahref="#cb1-4" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb1-5"><ahref="#cb1-5" aria-hidden="true" tabindex="-1"></a><spanclass="fu">Color</span> c.Black, c.Tomato</span>
<spanid="cb1-6"><ahref="#cb1-6" aria-hidden="true" tabindex="-1"></a><spanclass="kw">Print</span><spanclass="st">" Standard CSS Tomato background color "</span></span>
<spanid="cb1-7"><ahref="#cb1-7" aria-hidden="true" tabindex="-1"></a><spanclass="fu">Color</span> c.Black, c.LightSteelBlue</span>
<spanid="cb1-8"><ahref="#cb1-8" aria-hidden="true" tabindex="-1"></a><spanclass="kw">Print</span><spanclass="st">" Standard CSS LightSteelBlue background color "</span></span>
<spanid="cb1-9"><ahref="#cb1-9" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb1-10"><ahref="#cb1-10" aria-hidden="true" tabindex="-1"></a><spanclass="fu">rect</span><spanclass="dv">200</span>, <spanclass="dv">200</span>, <spanclass="dv">400</span>, <spanclass="dv">400</span><spanclass="fu">COLOR</span> c.DeepPink filled</span></code></pre></div>
<h2id="plugins">Plugins</h2>
<p>Plugins are libraries written in C which extent the functionality of
SmallBASIC. SmallBASIC offers an API to write your own plugins. The
following plugins are part of the release version of SmallBASIC: raylib
(2D and 3D game development), nuklear (GUI programming), clipboard,
gifencoder and WebSockets. You can also import a plugin for the
Raspberry Pi to use the GPIO ports and some additional hardware like
displays or temperature sensors.</p>
<divclass="sourceCode" id="cb2"><pre
class="sourceCode smallbasic"><codeclass="sourceCode smallbasic"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="co">' Example how to use raylib to open a window and print text.</span></span>
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb2-3"><ahref="#cb2-3" aria-hidden="true" tabindex="-1"></a><spanclass="pp">import</span> raylib <spanclass="kw">as</span> rl</span>
<spanid="cb2-4"><ahref="#cb2-4" aria-hidden="true" tabindex="-1"></a><spanclass="pp">import</span> raylibc <spanclass="kw">as</span> c</span>
<spanid="cb2-5"><ahref="#cb2-5" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb2-6"><ahref="#cb2-6" aria-hidden="true" tabindex="-1"></a><spanclass="dt">const</span> screenWidth = <spanclass="dv">800</span></span>
<spanid="cb2-7"><ahref="#cb2-7" aria-hidden="true" tabindex="-1"></a><spanclass="dt">const</span> screenHeight = <spanclass="dv">450</span></span>
<spanid="cb2-8"><ahref="#cb2-8" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb2-9"><ahref="#cb2-9" aria-hidden="true" tabindex="-1"></a>rl.InitWindow(screenWidth, screenHeight, <spanclass="st">"raylib [core] example - basic window"</span>)</span>
<spanid="cb2-10"><ahref="#cb2-10" aria-hidden="true" tabindex="-1"></a>rl.SetTargetFPS(<spanclass="dv">60</span>)</span>
<spanid="cb2-11"><ahref="#cb2-11" aria-hidden="true" tabindex="-1"></a></span>
<spanid="cb2-12"><ahref="#cb2-12" aria-hidden="true" tabindex="-1"></a><spanclass="kw">while </span>(!rl.WindowShouldClose())</span>
<spanid="cb2-13"><ahref="#cb2-13" aria-hidden="true" tabindex="-1"></a> rl.BeginDrawing()</span>
<spanid="cb2-14"><ahref="#cb2-14" aria-hidden="true" tabindex="-1"></a> rl.ClearBackground(c.RAYWHITE)</span>
<spanid="cb2-15"><ahref="#cb2-15" aria-hidden="true" tabindex="-1"></a> rl.DrawText(<spanclass="st">"Congrats! You created your first window!"</span>, <spanclass="dv">190</span>, <spanclass="dv">200</span>, <spanclass="dv">20</span>, c.LIGHTGRAY)</span>
<spanid="cb2-16"><ahref="#cb2-16" aria-hidden="true" tabindex="-1"></a> rl.EndDrawing()</span>
<spanid="cb2-17"><ahref="#cb2-17" aria-hidden="true" tabindex="-1"></a><spanclass="kw">wend</span></span>
<spanid="cb2-18"><ahref="#cb2-18" aria-hidden="true" tabindex="-1"></a>rl.CloseWindow()</span></code></pre></div>
<h2id="more-information">More information</h2>
<p>Read more in the short <ahref="/pages/guide.html">user guide</a> or
in the <ahref="/pages/vade.html">SmallBASIC handbook</a>. See the
documentation of all SmallBASIC commands in the <a
href="/pages/reference.html">language reference</a> or browse additional
articles in the <ahref="/pages/articles.html">article section</a>.</p>
</div>
<divclass="pagefooter">
This page was last edited on Thu, 13 Mar 2025 20:29:49 +0100
|
<ahref="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<ahref="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
</div>
</div>
</div>
</body>
</html>