-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimple05.html
More file actions
32 lines (31 loc) · 1.04 KB
/
Copy pathsimple05.html
File metadata and controls
32 lines (31 loc) · 1.04 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
---
layout: base.html
title: Simple HTML - Introducing variables 2
---
<section class="side-by-side">
<canvas class="game right" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<div>
<article>
<h1>Words and variables together</h1>
<p>You often need to display words next to the contents of
a variable. To do this you use <code class="command">PRINT</code> followed by the
variable name and the words, separated by a semicolon. In BASIC a semicolon tells the
computer to display the next piece of information on the same line.</p>
<p>A semicolon looks like <code>;</code>.</p>
<pre>
NEW
10 CLS
20 N=7
30 PRINT N; "SLIMY SLUGS"
40 PRINT "ATE, ";N;" SOGGY SANDWICHES"
RUN
</pre>
<p>The spaces <em>inside</em> the quotes on line 40 make the computer leave a space on the screen
between the words and the contents of the variable. You can also leave spaces <em>outside</em>
the quotes, but the computer ignores them.</p>
<footer>
<a href="{{ base_uri }}/simple06" class="button">Next</a>
</footer>
</article>
</div>
</section>