-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scorer.Htm
655 lines (582 loc) · 23.8 KB
/
Scorer.Htm
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
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta http-equiv="description"
content="Have you always wanted to know how to keep score in bowling, but were afraid to ask? It's really quite simple and can enhance your enjoyment when you go bowling. You can play an imaginary game here and - at the same time - teach yourself how to keep score for any possible combination of balls.">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Learn How to Keep Score in Tenpin Bowling</title>
<style>
<!--
body, p, h1, h2, h3, h4, h5, td, th, a {
font-family: Verdana, Arial, sans-serif;
font-size: 10pt
}
body {
margin-left: 0.8in;
margin-right: 0.4in;
color: Black
}
h1, h2, h3, h6 {
margin-left: -0.4in
}
body {
background-image: url(Sand.gif);
}
h1 {
font-size: 18pt;
color: Navy
}
h2 {
font-size: 16pt
}
h3 {
font-size: 16pt;
color: Navy;
font-style: Italic;
font-family: Times;
font-weight: Normal
}
h5 {
font-size: 8pt;
color: Gray;
font-style: Italic;
font-weight: Normal
}
h6 {
font-size: 8pt;
font-family: Times;
font-style: Italic;
font-weight: Normal
}
td {
font-size: 10pt;
font-family: Verdana, Arial
}
th {
background-color: Navy;
color: White;
font-style: Bold;
background-image: url(bgNavyV.jpg)
}
dt {
font-size: 10pt;
font-family: Verdana, Arial;
color: Navy;
font-weight: Bold
}
dd {
font-size: 10pt;
font-family: Verdana, Arial;
color: Black
}
a:hover {
color: Navy;
background-color: White
}
.evenLine {
background-color: #EEFFEE
}
.myBanner {
font-family: Times, serif;
font-size: 24pt;
font-style: Italic;
color: Silver
}
.LeadIn {
font-size: 11pt;
font-weight: Bold
}
.lnkHeader {
font-size: 10pt;
font-weight: Bold;
color: White;
background-color: Teal;
background-image: url(bgTealV.jpg)
}
.lnkBody {
font-size: 10pt;
background-color: Silver
}
.hdrRow {
font-size: 20pt;
font-family: Times, serif;
font-style: Italic;
color: Gray
}
-->
</style>
</head>
<body bgproperties="fixed">
<p><a name="Top"></a></p>
<div align="right">
<table border="0" cellpadding="2" cellspacing="0"
class="myNavBar">
<tr>
<td><a href="kWelcome.htm"
title="Go to the Home Page Master Index"><font
color="#808080">Home</font></a></td>
<td><a href="kVideo.htm"
title="A gallery of bowling Videos for you to watch"><font
color="#808080">Videos</font></a></td>
<td><a href="Gallery.htm"
title="A collection of Bowling Pictures for you to view and save"><font
color="#808080">Downloads</font></a></td>
<td><a href="tMain.htm"
title="Articles on the Equipment, Lane-Play and the Mental/Physical games"><font
color="#808080">Training</font></a></td>
<td><a href="ni_mens.htm"
title="Pictures and biographies of the NI Bowling Teams"><font
color="#808080">Teams</font></a></td>
</tr>
</table>
</div>
<div align="right">
<table border="0">
<tr>
<td align="right" class="myBanner">Mental</td>
</tr>
</table>
</div>
<h1>Bowling Score Computer</h1>
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="LeadIn">Do you enjoy bowling but
get confused by how to keep score? It's
really quite simple and can enhance your enjoyment when
you go bowling. You can play an imaginary game here and -
at the same time - teach yourself how to keep score for
any possible combination of balls. Have Fun!
</td>
<td valign="top" width="34%">
<div align="center">
<center>
<table
border="0" cellpadding="2">
<tr>
<td align="center" bgcolor="#008080"
class="LnkHeader">Links
</td>
</tr>
<tr>
<td valign="top" bgcolor="#C0C0C0">Want to find
out more about the sport? You can look at <a
href="Gallery.htm">pictures</a>, watch <a
href="kVideo.htm">videos</a> or find information
on <a href="tLane.htm">lanes</a> and <a
href="tPins.htm">pins</a>.
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<p>If you're interested we also have <a href="Scorer2.Htm">instructions</a>
on how to score, including explanations of terms such as "Strike"
and "Spare". Note, this is not quite finished since
Netscape compatibility will take some more work.</p>
<h6>Revised July 28th 2000</h6>
<hr width="80%">
<h3>Your Bowling Scoresheet</h3>
<p>You can learn how to keep score by using the simple "computer"
below. Choose your skill level (the advanced level will throw
more strikes, letting you see how strings of strikes raise the
score), hit the PLAY button then try to guess what the score will
be: press the SCORE button to check your score against the
computer. If you didn't get it right you can check it frame by
frame to see where you went wrong.</p>
<div align="center">
<center>
<table border="2" cellpadding="2" cellspacing="0" width="95%"
bgcolor="#FFFFFF">
<tr>
<th>Bowling Score Generator</th>
</tr>
<tr>
<td><h4>Your Scoresheet</h4>
<form method="POST" name="myForm">
<div align="center">
<center>
<table border="1"
cellpadding="2" cellspacing="2" width="95%" bgcolor="#C0C0C0"
id="ScoreSheet">
<tr>
<td>Name</td>
<td align="center" colspan="2" width="8%">1</td>
<td align="center" colspan="2" width="8%">2</td>
<td align="center" colspan="2" width="9%">3</td>
<td align="center" colspan="2" width="10%">4</td>
<td align="center" colspan="2" width="10%">5</td>
<td align="center" colspan="2" width="10%">6</td>
<td align="center" colspan="2" width="10%">7</td>
<td align="center" colspan="2" width="10%">8</td>
<td align="center" colspan="2" width="10%">9</td>
<td align="center" colspan="3" width="15%">10</td>
</tr>
<tr class="evenLine">
<td width="100">Kenn</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
<td align="center" width="50"
>
</td>
</tr>
<tr class="evenLine">
<td align="right">Score</td>
<td align="center" colspan="2" width="8%"
>
</td>
<td align="center" colspan="2" width="8%"
>
</td>
<td align="center" colspan="2" width="9%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="2" width="10%"
>
</td>
<td align="center" colspan="3" width="15%"
>
</td>
</tr>
</table>
</center>
</div>
<h4 align="left">Instructions</h4>
<div align="center">
<center>
<table border="1"
cellspacing="1" width="95%" bgcolor="#C0C0C0">
<tr>
<th width="20%">Step 1<br>
Select Level
</th>
<th>Step 2<br>
Enter Score
</th>
<th>Step 3<br>
Compute Score
</th>
</tr>
<tr>
<td valign="top"><input type="radio" checked
name="rbLevel" value="Level1"
onclick="SetLevel(1)">Beginner<br>
<input type="radio" name="rbLevel"
value="Level2" onclick="SetLevel(2)">Intermediate<br>
<input type="radio" name="rbLevel"
value="Level3" onclick="SetLevel(3)">Advanced
</td>
<td valign="top">Press <input type="button"
name="bReset" value="Reset"
onclick="ResetGame()">to erase scoreboard and
<input
type="button" name="bPlay" value="Play"
onclick="PlayGame()"> to generate a random
score sheet
</td>
<td valign="top">Press <input type="button"
name="bScore" value="Score"
onclick="ScoreGame()"> to compute the correct
score and have the computer check your score.
</td>
</tr>
</table>
</center>
</div>
</form>
</td>
</tr>
</table>
</center>
</div>
<hr width="80%">
<p align="right"><a href="kme.htm">Contact Information</a></p>
<div align="center">
<center>
<table border="3" cellpadding="2" cellspacing="0"
bgcolor="#C0C0C0">
<tr>
<td><a href="#Top">Top</a></td>
<td><a href="kwelcome.htm">Home</a></td>
<td><a href="kNitbf.Htm">NITBF</a></td>
<td><a href="Ni_Mens.Htm">Teams</a></td>
<td><a href="kvideo.htm">Video</a></td>
</tr>
</table>
</center>
</div>
<script language="JavaScript"><!--
var navVersion = navigator.appVersion;
var navName = navigator.appName;
// var ie4=((navName=="Microsoft Internet Explorer") && (parseInt(navVersion)>=4));
// var ns4=((navName=="Netscape") && (parseInt(navVersion)>=4));
var FirstBallArray = new Array(10);
var SecondBallArray = new Array(10);
var FinalBonusBall;
var aStrike = 10;
var aSpare = 10;
var gLevel = 1;
function isStrike(pinsDown) {
if (pinsDown == aStrike) return true; else return false;
}
function isSpare(pinsDown) {
if (pinsDown == aSpare) return true; else return false;
}
function ShowScore(theFrame, theScore) {
ScoreSheet.rows[2].cells[theFrame].innerText = theScore;
}
function PaintCell(row, cell, str) {
ScoreSheet.rows[row].cells[cell].innerText = str;
ScoreSheet.rows[1].cells[cell].backgroundColor = "Navy";
}
function PaintFrame(FrameNo) {
var PinsOn1stBall;
var PinsOn2ndBall;
var allPins;
var j;
//-- dont show the computed score until user hits the score button
ShowScore(FrameNo, '--');
//-- find out where we are & how many pins we hit
j = (FrameNo - 1) * 2 + 1;
PinsOn1stBall = FirstBallArray[FrameNo];
PinsOn2ndBall = SecondBallArray[FrameNo];
//-- display this frame
if (PinsOn1stBall == aStrike) {
PaintCell(1, j, "X");
PaintCell(1, j + 1, "");
if (PinsOn2ndBall == aStrike) {
PaintCell(1, j + 1, "X");
if (FinalBonusBall == aStrike) PaintCell(1, j + 2, "X"); else PaintCell(1, j + 2, FinalBonusBall);
}
else {
if (FrameNo == 10) {
PaintCell(1, j + 1, PinsOn2ndBall);
if ((PinsOn2ndBall + FinalBonusBall) == aSpare) PaintCell(1, j + 2, "/"); else PaintCell(1, j + 2, FinalBonusBall);
}
}
}
else {
PaintCell(1, j, PinsOn1stBall);
allPins = PinsOn1stBall + PinsOn2ndBall;
if (allPins == aSpare) {
PaintCell(1, j + 1, "/");
if (FrameNo == 10) {
PaintCell(1, j + 2, FinalBonusBall);
}
}
else {
PaintCell(1, j + 1, PinsOn2ndBall);
PaintCell(1, j + 2, "");
}
}
}
function Generate(PinsAlreadyDown) {
// simulate a bowler throwing a ball
// most we scan score is 10 pins, or less if some pins already down (on first ball)
// we incorporate the bowlers chosen "level" of ability into this equation
var maxPins;
maxPins = 10 - PinsAlreadyDown;
x = Math.round(Math.random() * maxPins * gLevel);
if (x > maxPins) {
x = maxPins
}
;
return x;
}
function PlayFrame(theFrame) {
var myFirstBall;
var myNextBall;
var PinsLeft;
if (theFrame < 10) {
//
//-- compute a 1st & 2nd score
//
myFirstBall = Generate(0);
myNextBall = Generate(myFirstBall);
FirstBallArray[theFrame] = myFirstBall;
SecondBallArray[theFrame] = myNextBall;
}
else {
// -- special handling for 10th frame
//
myFirstBall = Generate(0);
FirstBallArray[theFrame] = myFirstBall;
if (isStrike(myFirstBall)) {
myNextBall = Generate(0);
}
else {
myNextBall = Generate(myFirstBall);
}
SecondBallArray[theFrame] = myNextBall;
//
//-- check for final ball bonus
//
FinalBonusBall = 0;
if ((myFirstBall + myNextBall) >= 10) {
if (myNextBall == aStrike) FinalBonusBall = Generate(0); else FinalBonusBall = Generate(myNextBall);
}
}
}
function PlayGame() {
var thisFrame;
var maxFrames = 10;
thisFrame = 1;
while (thisFrame <= maxFrames) {
PlayFrame(thisFrame);
PaintFrame(thisFrame);
thisFrame = thisFrame + 1;
}
}
function SetName(aName) {
ScoreSheet.rows[1].cells[0].innerText = aName;
}
function SetLevel(theVal) {
// this script by onclick property of the radio buttons
// we set the global variable level (used to generate scores) & set name on scoresheet
gLevel = theVal
if (gLevel == 1) SetName("Beginner");
if (gLevel == 2) SetName("Intermediate");
if (gLevel == 3) SetName("Advanced");
}
function ResetGame() {
for (i = 1; i <= 10; i++) {
FirstBallArray[i] = 0;
SecondBallArray[i] = 0;
PaintFrame(i, 0, 0);
ShowScore(i, "--");
}
FinalBonusBall = 0;
}
function ScoreGame() {
var theScore;
theScore = 0;
for (i = 1; i < 10; i++) {
PinsInThisFrame = FirstBallArray[i] + SecondBallArray[i];
theScore = theScore + PinsInThisFrame;
if (isStrike(FirstBallArray[i])) {
theScore = theScore + FirstBallArray[i + 1] + SecondBallArray[i + 1];
if (isStrike(FirstBallArray[i + 1])) {
if (i < 9) theScore = theScore + FirstBallArray[i + 2];
}
}
else {
if (isSpare(PinsInThisFrame)) theScore = theScore + FirstBallArray[i + 1];
}
ShowScore(i, theScore);
}
// work out final frame score then display the score
theScore = theScore + FirstBallArray[10] + SecondBallArray[10] + FinalBonusBall;
ShowScore(i, theScore);
}
// --></script>
<!-- start of extreme -->
<p><a href="http://u.extreme-dm.com/?login=mr300" target="_top"><img
src="http://u1.extreme-dm.com/i.gif" border="0" width="41"
height="38" name="im">
<script language="javascript"><!--
an = navigator.appName;
d = document;
function
pr() {
d.write("<img src=\"http://u0.extreme-dm.com",
"/0.gif?tag=mr300&j=y&srw=" + srw + "&srb=" + srb + "&",
"rs=" + r + "&l=" + escape(d.referrer) + "\" height=1 ",
"width=1>");
}
srb = "na";
srw = "na";//-->
</script>
<script
language="javascript1.2"><!--
s = screen;
srw = s.width;
an != "Netscape" ?
srb = s.colorDepth : srb = s.pixelDepth;//-->
</script>
<script language="javascript"><!--
r = 41;
d.images ? r = d.im.width : z = 0;
pr();//-->
</script>
<noscript>
</a><img
src="http://u0.extreme-dm.com/0.gif?tag=mr300&j=n" width="1"
height="1"></noscript> <!--end of extreme --> </p>
</body>
</html>