-
Notifications
You must be signed in to change notification settings - Fork 0
/
ThingAMaJig
61 lines (53 loc) · 929 Bytes
/
ThingAMaJig
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
<!--Jeanine Rioux-->
<!--CSC 14A 9/17/18 -->
<!-- Thing a ma jig-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Thing-a-ma-jig</title>
</head>
<body>
</body>
<script>
function clunk(times)
{
var num = times;
while(num > 0)
{
display("clunk");
num = num - 1;
}// end while
}// end function clunk
function thingamajig(size)
{
var facky = 1;
clunkCounter = 0;
if (size == 0)
display ("clank");
else if (size == 1)
display ("thunk");
else
{
while (size > 1)
{
facky = facky * size;
size = size - 1;
}//end while
clunk(facky);
}//end else
}//end function thingamajig
function display(output)
{
console.log(output);
clunkCounter = clunkCounter + 1;
}//end function display
for (var i = 0; i<=9; i++)
{
var clunkCounter = 0;
thingamajig(i);
console.log(clunkCounter);
}//end forloop
</script>
</body>
</html>