-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsmallbasic.html
More file actions
550 lines (547 loc) · 19.5 KB
/
Copy pathsmallbasic.html
File metadata and controls
550 lines (547 loc) · 19.5 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | smallbasic</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/smallbasic.html">
<link rel="keywords" href="smallbasic">
<link rel="stylesheet" href="/css/style.css">
<link rel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
</head>
<body>
<div class="wrapAll clearfix">
<div class="sidebar">
<div class="logo">
<a href="/"><img src='/images/sb-desktop-128x128.png' alt="logo"></a>
</div>
<div class="navigation">
<h4>SmallBASIC</h4>
<ul>
<li><a href="/">Main page</a></li>
<li><a href="/pages/download.html">Download</a></li>
<li><a href="/pages/reference.html">Language reference</a></li>
<li><a href="/pages/samples.html">Code library</a></li>
</ul>
<hr class="menuSeparator"/>
<ul>
<li><a href="/pages/articles.html">Artices</a></li>
<li><a href="/pages/community.html">Community</a></li>
<li><a href="/pages/changelog.html">Changelog</a></li>
<li><a href="/pages/screenshots.html">Screenshots</a></li>
<li><a href="/pages/links.html">Links</a></li>
</ul>
<hr class="menuSeparator"/>
<ul>
<li><a href="https://play.google.com/store/apps/details?id=net.aircave">Air Cave Game</a></li>
</ul>
</div>
</div>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsLeft">
<ul>
<li><a href="#" class="active">Article</a></li>
<li><a href="https://www.syntaxbomb.com/index.php/board,54.0.html">Discuss</a></li>
</ul>
</div>
<div id="simpleSearch">
<div id="submitSearch"></div>
<form action="https://github.com/smallbasic/smallbasic.github.io/search"
target="_github" accept-charset="UTF-8" method="get" style="display:inline">
<input type="hidden" class="js-site-search-type-field" name="type">
<input type="hidden" name="utf8" value="✓">
<input type="hidden" name="l" value="Visual Basic">
<input type="text" name="q" placeholder="Search" size="12" id="searchInput">
</form>
</div>
<div class="tabsRight">
<ul>
<li><a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/smallbasic.markdown">View source</a></li>
<li><a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/smallbasic.markdown">View history</a></li>
</ul>
</div>
</div>
<div class="article">
<h1 id="programming-smallbasic">Programming SmallBASIC</h1>
<blockquote>
<p>Gerard Thomas Labèrnia</p>
</blockquote>
<div class="articleRight">
<div class="articleRightInner">
<p>Contents</p>
</div>
<ul>
<li><a href="#intro">Introduction to SmallBASIC</a></li>
<li><a href="#structure">Structure of a program in SmallBASIC</a></li>
<li><a href="#editor">Program Editor</a></li>
<li><a href="#commands">Commands in SmallBASIC</a></li>
<li><a href="#screenCommands">Screen commands</a></li>
<li><a href="#jumpCommands">Jump commands</a></li>
<li><a href="#conditional">Conditional commands</a></li>
<li><a href="#repeat">Repetition commands</a></li>
<li><a href="#graphicCommands">Graphic commands</a></li>
<li><a href="#graphics">Graphics / Color code</a></li>
<li><a href="#exercises">Programming Exercises</a></li>
</ul>
</div>
<p><img src="/images/media/image1.png" /></p>
<h2 id="preface">Preface</h2>
<p>This document seeks to introduce students to the world of programming. It can be used not only for technology, also drawing on other subjects, Mathematics, Physics, Music, English.</p>
<p>At the time of the first commercial computer programs were rare, the software that is the machine software was developed by the users themselves, who often programmed their own applications. It is important to recover this spirit so that students realize the importance of knowing how to program a computer to do their own programs.</p>
<h2 id="intro">Introduction to SmallBASIC</h2>
<p>Programming is the process of putting instructions on the computer to tell what functions are performed and in what order to do it. The aim of this subject began to make our first programs.</p>
<p>SmallBASIC is a language of computer programming based on BASIC. BASIC stands for Beginner’s All-Purpose Symbolic Instruction Code.</p>
<p>BASIC language is a high level, as well as C and is very suitable for beginners in the world of programming. BASIC is one of the most popular programming languages. It’s easy to learn and use, and their commands very similar to English (eg Print, Input) and its power.</p>
<p>SmallBASIC has a simple interface and many mathematical functions and graphics. It is an ideal tool for experimenting with simple algorithms and fun. It has a very simple structure for the programs, their lines can be numbered (10, 20, 30, etc.) are executed in order.</p>
<h2 id="structure">Structure of a program in SmallBASIC</h2>
<p><img src="/images/media/image3.png" /></p>
<p>We can see the line numbers and the most common commands for separate two commands on one line, use the two points.</p>
<p><img src="/images/media/image4.jpeg" /></p>
<p>Window work SmallBASIC</p>
<h2 id="editor">Program Editor</h2>
<p>In this section you will learn to work with the program editor:</p>
<ul>
<li>Enter the first program</li>
<li>Save the program file to disk</li>
<li>Recover files on disk</li>
<li>Run the program</li>
<li>Check it properly</li>
<li>Using Help</li>
<li>Leave SmallBASIC</li>
</ul>
<p>Steps to follow:</p>
<ol type="I">
<li>We will create a folder on the USB drive to store programs. For example: Basic.</li>
<li>Run the program My Computer> All Programs> SmallBASIC> SmallBASIC.</li>
<li>The menu File> New file and type the following program:</li>
</ol>
<p>Note: It is very important that you type the program exactly, otherwise the program will not work and get errors</p>
<pre><code>10 REM First program
20 CLS
30 PRINT "Welcome to"
40 PRINT "basics": PLAY "CDE"
50 END</code></pre>
<ol start="4" type="I">
<li><p>Stores program previously created the directory, menu File> Save File As, how Example.bas.</p></li>
<li><p>To skip this step. To retrieve the file from the program menu File> Open File.</p></li>
<li><p>To run the program press the F9</p></li>
<li><p>Checking If everything is correct, you get the following result and musical notes, but revised the lines of the program and run it again.</p></li>
</ol>
<p>Welcome to the basics</p>
<ol start="8" type="I">
<li><p>Using help: Press F1.</p></li>
<li><p>To leave SmallBASIC menu File> Exit</p></li>
</ol>
<p>Interesting note: In the Edit menu, we have the options: Cut, Copy and Paste, very useful in editing programs, but have previously selected the mouse or text lines.</p>
<p>Keyboard shortcuts for working with the program:</p>
<table style="width:68%;">
<colgroup>
<col style="width: 11%" />
<col style="width: 56%" />
</colgroup>
<tbody>
<tr class="odd">
<td>F9</td>
<td>Run the program.</td>
</tr>
<tr class="even">
<td>Ctrl+F4</td>
<td>Close Tabs programs or program information.</td>
</tr>
<tr class="odd">
<td>Ctrl+B</td>
<td>Stop the program (useful when it is in a loop without leaving the program)</td>
</tr>
</tbody>
</table>
<p>3.1 Programming Course</p>
<p>Phases:</p>
<ol type="1">
<li>EX1.bas to EX7.bas.</li>
<li>P1.bas to P19.bas.</li>
<li>EX8.bas to EX13.bas.</li>
<li>EX20.bas to EX26.bas.</li>
<li>Major commands SmallBASIC 4.1 Commands screen</li>
</ol>
<dl>
<dt><code>REM (remark)</code></dt>
<dd>Insert a comment in a program.
</dd>
<dt><code>CLS (clear screen)</code></dt>
<dd>Delete everything on the screen.
</dd>
<dt><code>COLOR</code></dt>
<dd>Change the text color and background of the screen (color code at the end of section 4.5).
</dd>
<dt><code>COLOR A, B</code></dt>
<dd>Change the text color of the screen background color A and B.
</dd>
<dt><code>PRINT (print)</code></dt>
<dd>View numerical data or text on the screen.
</dd>
</dl>
<h3 id="ex1.bas">EX1.BAS</h3>
<pre><code>REM Command
10 PRINT
20 CLS
30 PRINT "HELLO"
40 COLOR 1.12: PRINT 20 + 20</code></pre>
<p>Result screen:</p>
<pre><code>HELLO 40</code></pre>
<dl>
<dt><code>locate</code></dt>
<dd>Place the cursor on the screen in a coordinated expressed in rows and columns.
</dd>
</dl>
<h3 id="ex2.bas">EX2.BAS</h3>
<pre><code>10 REM locate command
20 CLS
30 Locate 12.10
40 PRINT "HELLO"</code></pre>
<p>Result screen:</p>
<p><img src="/images/media/image5.png" /></p>
<p>Placing text and locate PRINT</p>
<dl>
<dt><code>INPUT</code></dt>
<dd>Enter the value of one variable from the keyboard.
</dd>
</dl>
<h3 id="ex3.bas">EX3.BAS</h3>
<pre><code>10 REM Input Command
20 CLS
30 PRINT "Age?"
40 INPUT A
50 PRINT A: PRINT "Years"</code></pre>
<p>Result screen:</p>
<pre><code>Age ?
15 Years</code></pre>
<p>(To keep the variable value 15 entered from the keyboard)</p>
<dl>
<dt><code>STOP</code></dt>
<dd>Stop the execution of a program.
</dd>
<dt><code>END</code></dt>
<dd>Ending a program.
</dd>
<dt><code>PAUSE</code></dt>
<dd>Stop the computer.
</dd>
<dt><code>PAUSE t</code></dt>
<dd>Stop the computer during t seconds.
</dd>
<dt><code>SQR (square root)</code></dt>
<dd>Make the square root operation
</dd>
</dl>
<h3 id="ex4.bas">EX4.BAS</h3>
<pre><code>10 REM Command SQR
20 CLS
30 PRINT SQR(25)</code></pre>
<p>Command</p>
<p><code>30 PRINT SQR (25)</code></p>
<p>Result screen:</p>
<h2 id="jumpCommands">Jump commands</h2>
<dl>
<dt><code>GOTO</code></dt>
<dd>Skip the execution of the program line indicated.
</dd>
</dl>
<h3 id="ex5.bas">EX5.BAS</h3>
<pre><code>10 REM Command GOTO
20 CLS
30 PRINT “HELLO”
40 GOTO 60
50 PRINT "student"
60 END</code></pre>
<p>Result screen:</p>
<pre><code>HELLO</code></pre>
<p>(Line 50 will not run)</p>
<h2 id="conditional">Conditional commands</h2>
<p><code>IF - THEN - ELSE</code></p>
<p>Forks execution according to the value of an expression. If the value of the expression is true, will run the following command THEN and if false run the following ELSE.</p>
<p>ELSE can be omitted, and simply continue the program in the following order.</p>
<h3 id="ex6.bas">EX6.BAS</h3>
<pre><code>10 REM Ordre IF – THEN – ELSE
20 CLS
30 PRINT “EDAT?”
40 INPUT A
50 IF A>17 THEN PRINT "ADULT" ELSE PRINT "MINOR"
</code></pre>
<p>Result screen:</p>
<pre><code>AGE?
11
MINOR</code></pre>
<h2 id="repeat">Repetition commands (loops)</h2>
<dl>
<dt><code>FOR - NEXT</code></dt>
<dd>Repeat part of a program a certain number of times.
</dd>
</dl>
<h3 id="ex7.bas">EX7.BAS</h3>
<pre><code>10 REM Command FOR – NEXT
20 CLS
30 FOR I=1 TO 4
40 PRINT "GOOD MORNING"
50 NEXT I</code></pre>
<p>Result screen:</p>
<pre><code>GOOD MORNING
GOOD MORNING
GOOD MORNING
GOOD MORNING</code></pre>
<h3 id="graphicCommands">Graphic commands</h3>
<p>Before starting commands graphic graphics grid looks at the end of the chapter, to put points on the screen.</p>
<dl>
<dt><code>PSET</code></dt>
<dd>Draw a dot on the screen.
</dd>
<dt><code>PSET ( X, Y), color</code></dt>
<dd>Draw a point on the screen coordinates (x, y) and the desired color.
</dd>
</dl>
<h3 id="ex8.bas">EX8.BAS</h3>
<pre><code>10 REM Command PSET
30 PSET 320,240,1
40 PSET 320,250,1
50 PSET 320,260,1
60 END</code></pre>
<p>Result screen:</p>
<p>(Look closely at the three black spots on the screen)</p>
<dl>
<dt><code>LINE</code></dt>
<dd>Draw a line on the screen.
</dd>
<dt><code>LINE X1, Y1, X2, Y2, color</code></dt>
<dd>Draw a line on the screen from the initial point (x1, y1) to the end point (x2, y2) and the desired color.
</dd>
</dl>
<h3 id="ex9.bas">EX9.BAS</h3>
<pre><code>10 REM Command LINE
30 LINE 40,40,480,440,14
40 PAUSE 1
50 LINE 40,440,480,40,12
60 END</code></pre>
<dl>
<dt><code>RECT</code></dt>
<dd>Draw a rectangle on the screen.
</dd>
<dt><code>rect X1, Y1, X2, Y2, color</code></dt>
<dd>Draw a rectangle on the screen, given by the value of the points of a diagonal from the starting point (x1, y1) to the end point (x2, y2) and the desired color.
</dd>
</dl>
<h3 id="ex10.bas">EX10.BAS</h3>
<pre><code>10 REM Command RECT
30 RECT 40,40,480,440,1
40 PAUSE 1
50 RECT 10,10,100,100,12
60 END</code></pre>
<dl>
<dt><code>CIRCLE</code></dt>
<dd>Draw a circle on the screen.
</dd>
<dt><code>CIRCLE X, Y, radius, proportion, color</code></dt>
<dd>Draw a circle on the coordinates (x, y), the radius and the desired color. The ratio of a circle equals 1.
</dd>
</dl>
<h3 id="ex11.bas">EX11.BAS</h3>
<pre><code>10 REM Command CIRCLE
20 CLS
30 CIRCLE 320,200,30,1,14
40 PAUSE 1
50 CIRCLE 320,100,40,1,1
60 PAUSE 1
70 CIRCLE 200,100,50,0.5,12
80 END</code></pre>
<p>Give color to a closed area of the screen.</p>
<dl>
<dt><code>PAINT X, Y, color color border area</code></dt>
<dd>Give color to a closed area of the screen coordinates (x, y), and the desired color.
</dd>
</dl>
<p><span class="underline">Important: It i</span>s mandatory to indicate the color of the border area, if not the same, will color the whole screen.</p>
<h3 id="ex12.bas">EX12.BAS</h3>
<pre><code>10 REM Command PAINT
20 CLS
30 CIRCLE 100,100,30,1,1
40 PAUSE 1
50 PAINT 100,100,1
60 CIRCLE 200,100,40,1,12
70 PAUSE 1
80 PAINT 200, 100,12
90 END</code></pre>
<p>Note: Commands RECT and CIRCLE, FILLED option can lead to an end. This option automatically painted inside the rectangle or circle.</p>
<h3 id="ex13.bas">EX13.BAS</h3>
<pre><code>10 REM option FILLED
20 CLS
30 CIRCLE 100,100,30,1,14 FILLED
40 PAUSE 1
50 RECT 100,100,640,480,1 FILLED
60 END</code></pre>
<p><img src="/images/media/image6.jpeg" /></p>
<h2 id="exercises">Programming Exercises</h2>
<p>Enter these programs on your computer and store it in your USB memory folder. Run each, please tell us the result and performance. Where necessary enter the program.</p>
<p><strong>P1.bas</strong> (Operations)</p>
<pre><code>10 CLS
20 PRINT 3+5
30 PRINT 100-60
40 PRINT 5 * 6
50 PRINT 120/40
60 PRINT (4+5) * 4</code></pre>
<p><strong>P2.bas</strong> Write a program that performs the following operations:</p>
<pre><code>(230 + 345) / 23</code></pre>
<p><strong>P3.bas</strong> (Text and numbers)</p>
<pre><code>10 CLS
20 PRINT "I'm a PC"
30 PRINT "How are you?"
40 PRINT "3+5"</code></pre>
<p>Why doesn’t the last printed line result in 8?</p>
<p><strong>P4.bas</strong> (Locate)</p>
<pre><code>10 CLS
20 LOCATE 12,40:PRINT "A"
30 LOCATE 12,42:PRINT "B"
40 LOCATE 12,44:PRINT "C"</code></pre>
<p><strong>P5.bas</strong> Write a program to make the next screen row and column indication. (Locate)</p>
<pre><code>MENU
1 PLAY
2 OPTIONS
3 EXIT</code></pre>
<p><strong>P6.bas</strong> (Variables, variables are like boxes where you can store values, and then use them)</p>
<pre><code>10 CLS
20 A=6
30 PRINT A
40 B=7
50 PRINT B</code></pre>
<p><strong>P7.bas</strong> (Sum)</p>
<pre><code>10 CLS
20 A=3:PRINT A
30 B=6:PRINT B
40 C=A+B
50 PRINT "Suma="
60 PRINT C</code></pre>
<p><strong>P8.bas</strong> Make a program similar to the above to do the sum, product and quotient of two numbers given in variables.</p>
<p><strong>P9.bas</strong> (INPUT A and B by entering sum keyboard)</p>
<pre><code>10 CLS
20 PRINT "A="
30 INPUT A
40 PRINT "B="
50 INPUT B
60 C=A+B
70 PRINT"SUMA="
80 PRINT C</code></pre>
<p><strong>P10.bas</strong> Make a program similar to the above to do the sum, product and quotient of two numbers as input variables INPUT.</p>
<p><strong>P11.bas</strong> Make a program to calculate the area of a triangle.</p>
<pre><code>A=(B·H)/2</code></pre>
<p><strong>P12.bas</strong> Make a program that carries out the conversion of euros in pesetas.</p>
<p>1 € = 166.386 pts</p>
<p><strong>P13.bas</strong> Make a program that carries out the conversion of pesetas into euros.</p>
<p><strong>P14.bas</strong> Write a program to calculate the average of three numbers.</p>
<p>tracks:</p>
<pre><code>INPUT A
INPUT B
INPUT C
M=(A+B+C)/3</code></pre>
<p>1st review Note:</p>
<p>4Nota 2nd test: 3rd</p>
<p>test 6Nota: 5Mitja 5</p>
<p><strong>P15.bas</strong> (FOR-NEXT loop)</p>
<pre><code>10 CLS
20 FOR I = 1 TO 20
30 PRINT "*";
40 NEXT I</code></pre>
<p>What happens if the camshafts; which bears the print behind?</p>
<p><strong>P16.bas</strong></p>
<p>(FOR-NEXT loop, and locate PRINT)</p>
<pre><code>10 CLS
20 FOR I = 1 TO 15
30 LOCATE I, 15: PRINT "*"
40 LOCATE I, 20: PRINT "$"
60 LOCATE I, 25: PRINT "@"
70 LOCATE 20, I: PRINT "%"
80 NEXT I</code></pre>
<p><strong>P17.bas</strong> (Game with GOTO, IF - THEN)</p>
<pre><code>10 CLS
20 X = 6
30 PRINT "************ Guess the number ************"
40 PRINT "************ (0 a 10) ************"
50 INPUT A
60 IF A = X THEN GOTO 100
70 IF A > X THEN PRINT " ----MENOR----"
80 IF A < X THEN PRINT " ----MAJOR----"
90 GOTO 50
100 PRINT " $$$$$ You've almost got $$$$$"
110 PLAY "O2T255CDCDO6DCDC"</code></pre>
<p>Write next to each line of the program that performs the function</p>
<p><strong>P18.bas</strong> Make a program that asks you the password (a number) to continue and if the correct sounding music and the text " correct password "</p>
<p><strong>P19.bas</strong> Program menu: Calculator euros</p>
<pre><code>10 REM CALCULADORA D'EUROS
20 CLS
30 PRINT "CALCULADORA D'EUROS"
40 PRINT "1. EUROS A PTS"
50 PRINT "2. PTS A EUROS"
60 PRINT "TRIA L'OPCIÓ"
70 INPUT A
80 IF A = 1 THEN GOTO 100
90 IF A = 2 THEN GOTO 200
100 REM EUROS A PTS
110 CLS
120 PRINT "EUROS A PTS"
130 PRINT "EUROS"
140 INPUT EUROS
150 PTS = EUROS * 166.386
160 PRINT "PTS="
170 PRINT PTS
180 END
200 REM PTS A EUROS
210 CLS
220 PRINT "PTS A EUROS"
230 PRINT "PTS"
240 INPUT PTS
250 EUROS = PTS / 166.386
260 PRINT "EUROS="
270 PRINT EUROS
280 END</code></pre>
<pre><code>80 IF A = 1 THEN GOTO 100 90 IF A = 2 THEN GOTO 200 100 EUROS IN
REM CLS 110 PTS</code></pre>
<p>220 PRINT “PTS Euro” 230 PRINT</p>
<p>“PTS” INPUT 240 PTS</p>
<p>PTS = 250 euros / 166 386 260 PRINT</p>
<p>“EURO =” 270 PRINT END 280 EUROS</p>
<p>PRINTING THE</p>
<p>MENU</p>
<p>TO CHOOSE THE</p>
<p>OPTION</p>
<p>SUBPROGRAMME: PTS</p>
<p>IN EUROS</p>
<p>SUBPROGRAMME: PTS</p>
<p>IN EUROS</p>
<p><strong>P20.bas</strong> ( Command LINE)</p>
<pre><code>10 SCREEN 12
20 LINE 5,5,105,105,14
30 END</code></pre>
<p><strong>P21.bas</strong> (Command RECT)</p>
<pre><code>10 CLS
20 RECT 5,5,105,105,14
30 END</code></pre>
<p><strong>P22.bas</strong> (Command RECT, drawing a colored rectangle)</p>
<pre><code>10 CLS
20 RECT 5,5,105,105,14 FILLED
30 END</code></pre>
<p>Explain the difference between the three previous programs</p>
<p><strong>P23.bas</strong> Make a program that does the following figure, each circle a different color (Use the grid on page 10 and make an outline prior to placing coordinates):</p>
<p><img src="/images/media/image37.jpeg" /></p>
<p><strong>P24.bas</strong> Make a program that draws a triangle colored red and painted yellow inside.</p>
</div>
<div class="pagefooter">
This page was last edited on Sun, 14 Feb 2021 10:54:06 +1000
|
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 2.5</a>
| Template by <a href="http://html5-templates.com/" target="_blank" rel="nofollow">HTML5 Templates</a>
</div>
</div>
</div>
</body>
</html>