64 lines
1.2 KiB
HTML
64 lines
1.2 KiB
HTML
{% extends "layout.html" %}
|
|
{% block body %}
|
|
|
|
<script type="text/javascript">
|
|
//Change active button in navbar
|
|
$("document").ready( function(){
|
|
$("li").removeClass("active");
|
|
$("#examples").addClass("active");
|
|
});
|
|
|
|
</script>
|
|
|
|
<div class="hero-unit">
|
|
<p>First example is...</p>
|
|
<div class="row-fluid">
|
|
<div class="span8">
|
|
<h2>Code</h2>
|
|
<pre class="code">
|
|
println("I start program by assigning 0 to x");
|
|
x = 0;
|
|
println("Then I declare a table, which is not obligatory");
|
|
array t[100];
|
|
println("After that I fill the table like that:");
|
|
|
|
while (x < 10)
|
|
{
|
|
print("Index: ", x);
|
|
t[x] = 3*x;
|
|
println(", value: ", t[x]);
|
|
x = x + 1;
|
|
}
|
|
|
|
println("Pretty simple isn't it?");
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="span4">
|
|
<h2>Comments</h2>
|
|
Comments to code.
|
|
</div>
|
|
|
|
</div>
|
|
<h2>Output</h2>
|
|
<pre>
|
|
I start program by assigning 0 to x
|
|
Then I declare a table, which is not obligatory
|
|
After that I fill the table like that:
|
|
Index: 0, value: 0
|
|
Index: 1, value: 3
|
|
Index: 2, value: 6
|
|
Index: 3, value: 9
|
|
Index: 4, value: 12
|
|
Index: 5, value: 15
|
|
Index: 6, value: 18
|
|
Index: 7, value: 21
|
|
Index: 8, value: 24
|
|
Index: 9, value: 27
|
|
Pretty simple isn't it?
|
|
</pre>
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %} |