Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
185 lines (130 loc) · 6.39 KB
/
Copy pathindex.html
File metadata and controls
185 lines (130 loc) · 6.39 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
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-66232368-1', 'auto');
ga('send', 'pageview');
$('body').scrollspy({
target: '.bs-docs-sidebar',
offset: 40
});
</script>
<title>Docs</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/assets/bootstrap_min_css.css">
<!-- Custom styles for this template -->
<link href="/assets/offcanvas.css" rel="stylesheet">
<link href="/assets/docsmin.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/assets/mods.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="/assets/html5shiv.min.js"></script>
<script src="/assets/respond.min.js"></script>
<![endif]-->
</head>
<body data-twttr-rendered="true">
<nav class="navbar navbar-fixed-top navbar-inverse navfront" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li ><a href="../../">
CommonWealth Robotics</a></li>
<li ><a href="../../tutorials/">
Tutorials</a></li>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</nav><!-- /.navbar -->
<div class="container bs-docs-container">
<div class="row">
<!-- menu -->
<div class="col-sm-3">
<div class="bs-docs-sidebar hidden-print affix-top">
<a href="../forloops/" class="btn btn-default navbtn pull-left btn-sm" aria-label="Left Align">
<span aria-hidden="true"></span>
Previous
</a>
<a href="../ifstatements/" class="btn btn-default navbtn btn-sm" aria-label="Right Align">
Next
<span aria-hidden="true"></span>
</a><br>
<ul class="nav bs-docs-sidenav active" data-spy="active" data-offset-top="25" data-offset-bottom="20">
<li><strong>A Simple Java Tutorial</strong><hr class="menuhr" /></li>
<li >
<a href="../binary/">Binary</a></li>
<li >
<a href="../primativetypes/">Primitive Types</a></li>
<li >
<a href="../forloops/">For Loops</a></li>
<li class="active" >
<a href="./">While Loops</a></li>
<li >
<a href="../ifstatements/">If Statements</a></li>
<li >
<a href="../ifstatementsquiz/">If Statements Quiz</a></li>
<li >
<a href="../elseifstatements/">Else/If Statements</a></li>
<li >
<a href="../elsestatements/">Else Statements</a></li>
<li >
<a href="../classes/">Classes</a></li>
<li >
<a href="../constructors/">Constructors</a></li>
</ul> <!-- nav bs-docs-sidenav -->
</div> <!-- bs-docs-sidebar -->
</div> <!-- col-md-3 -->
<!-- page content -->
<div class="col-sm-9" role="main">
<div class="bs-docs-section">
<h2 id="lets-learn-loops">Let’s Learn Loops!</h2>
<h3 id="a-while-loop">A While Loop</h3>
<p>We will use the same project we did in the for loop example to learn how while loops work. So like in the for loop we
need to have a conditional that needs to be met <code>while</code> the loop runs. We can use the same condition we used in the
previous example.</p>
<p>Now we can’t just print out i, or it will not do anything other than print out 1 forever, but in the body of the loop,
or the space between the two curly braces <code>{}</code>, we can do something similar to what we did above with the for loops.</p>
<script src="https://gist.github.com/madhephaestus/900e15bf3a2ccc0a510d.js"></script>
<p>You can see in the body we print out i and then increment it by two so that when the loop runs again it will print out
3, 5, 7, and so on.</p>
</div>
</div>
</div> <!-- row -->
</div> <!-- container bs-docs-container -->
<!--
<footer class="bs-docs-footer" role="contentinfo">
<div class="container">
Woo! Footer!
</div>
</footer>
-->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/assets/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="/assets/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="/assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="/assets/holder.js"></script>
<script src="/assets/offcanvas.js"></script>
</body>
</html>