Semester 3 pog

This commit is contained in:
2023-08-16 17:31:33 -05:00
parent 2dc89a3b93
commit a33c99cbd2
1558 changed files with 439 additions and 0 deletions

View File

@@ -0,0 +1,121 @@
body { background-color: #000040;
background-image: url(background.gif);
color: #88ffff;
font-family: Verdana, Arial, sans-serif;
}
#container { margin-left: auto;
margin-right: auto;
width:80%;
min-width:700px;
}
#logo {
text-align:center;
margin: 0;
font-family: Geneva, Arial, Helvetica, sans-serif;
padding-top: 30px;
padding-bottom: 20px;
}
#nav {
float: left;
width: 200px;
padding-top: 10px;
text-align:left;
color: #88FFFF;
font-size: 12px;
}
#nav a {text-decoration:none;
margin: 15px;
display: block;
color: #88FFFF;
font-size: 12px;
}
#content {
margin-left: 150px;
padding: 30px;
overflow:auto;
border: medium groove #88FFFF;
line-height: 135%;
}
.floatright {padding-left:20px;
float:right;
}
.floatleft {
float:left;
padding: 30px 0px 20px;
}
#footer { font-size: .60em;
font-style: italic;
text-align: center;
border-top: 2px double #000040;
padding-top: 20px;
padding-bottom: 20px;
}
h2 { text-transform: uppercase;
color: #88ffff;
font-size: 1.2em;
border-bottom: 1px none;
margin-right: 20px;
}
h3 {
color: #88ffff;
font-size: 1.2em;
border-bottom: 1px solid #000000;
margin-right: auto;
text-align: left;
padding-top: 10px;
padding-right: 20px;
padding-bottom: 10px;
padding-left: 20px;
line-height: 120%;
}
.details { padding-left:20%;
padding-right:20%;
}
img {border:0; }
.content {
margin: 20px;
padding: 20px;
height: 3700px;
width: 500px;
}
a {text-decoration:none;
margin: 15px;
display: block;
color: #88FFFF;
font-size: 12px;
}
a:hover {
color: #000040;
background-color: #88ffff;
}
span {
font-size: 20px;
font-weight: bold;
font-family: "Courier New", Courier, mono;
color: #88ffff;
background-position: center center;
text-align: center;
vertical-align: middle;
}
table {
border-collapse: collapse
}
td {
border: 2px solid #88ffff;
width: 5em;
color: #88ffff;
}
.nobdr {
border: none;
cell-padding: 5px;
}

View File

@@ -0,0 +1,110 @@
<html>
<head>
<title>Greg's Gambits | Hangman</title>
<link href="greg.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="mySource.js"></script>
<script>
function startHangman()
{
var nooseCount = 0;
var wordNum = Math.floor((Math.random()*9)+1);
var picture = "pic" + wordNum + ".jpg";
switch(wordNum)
{
case 1:
word = "ghost"; break;
case 2:
word = "horse"; break;
case 3:
word = "insect"; break;
case 4:
word = "celery"; break;
case 5:
word = "pelican"; break;
case 6:
word = "jewelbox"; break;
case 7:
word = "castle"; break;
case 8:
word = "monster"; break;
case 9:
word = "bunny"; break;
}
alert("Hehehehe... We're cheater's. WORD = " + word );
var newWord = ""; var win = false;
var lgth = word.length; var guessLetter; var goodGuess = false;
for (var i = 0; i < lgth; i++)
newWord = newWord + "_ ";
document.getElementById("noose").innerHTML = ("<img src ='images/hangman0.gif' />");
document.getElementById("game").innerHTML = newWord;
while (win == false && nooseCount < 10)
{
goodGuess = false;
guessLetter = prompt("Guess a letter");
for (var j = 0; j < lgth; j++)
{
if (guessLetter == word.charAt(j))
{
goodGuess = true;
var offSet = 2*j;
newWord = setCharAt(newWord, offSet, guessLetter);
}
}
document.getElementById("game").innerHTML = newWord;
win = checkWord(word, newWord);
if (win == true)
{
document.getElementById("result").innerHTML = ("You win!");
document.getElementById("noose").innerHTML = ("<img src = '" + picture + "' />");
}
else if (win == false)
{
document.getElementById("result").innerHTML = ("not a winner yet");
if (goodGuess == false)
nooseCount = nooseCount + 1;
document.getElementById("noose").innerHTML = ("<img src ='images/hangman" + nooseCount + ".gif' />");
}
}
}
function checkWord(word, otherWord)
{
var cleanWord;
cleanWord = otherWord;
cleanWord = otherWord.replace(/ /g, "");
if (word == cleanWord)
return true;
else
return false;
}
function setCharAt(str,index,chr)
{
if(index > str.length-1)
return str;
return str.substr(0,index) + chr + str.substr(index+1);
}
</script>
</head>
<body>
<div id="container">
<img src="images/superhero.jpg" class="floatleft" />
<h1 id="logo"><em>The Game of Hangman</em></h1>
<h2 align="center">Greg Challenges You to a Game of Hangman</h2>
<p>&nbsp;</p>
<div id="nav">
<p><a href="index.html">Home</a>
<a href="greg.html">About Greg</a>
<a href="play_games.html">Play a Game</a>
<a href="sign.html">Sign In</a>
<a href="contact.html">Contact Us</a></p>
</div>
<div id="content" style="width: 600px; margin-left: auto; margin-right: auto;">
<p><input type="button" value = "Start the game" onclick="startHangman();" /></p>
<div id = "noose" class = "floatright"><img src ="images/hangman10.gif" /></div>
<div id = "game"><p>&nbsp;</p></div>
<div id = "result"><p>&nbsp;</p></div>
</div>
<div id="footer">Copyright &copy; 2013 Greg's Gambits<br />
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,72 @@
function checkRange(x,low,high)
{
var x; var low; var high;
var result = true;
if (x < low || x > high)
result = false;
return result;
}
function charAtPlace(x, y, z)
{
var x; var y; var z; var result = false;
if (x.charAt(y-1) == z)
result = true;
return result;
}
function checkForChar(x, y)
{
var x; var y; var i; var lgth; var result = false;
lgth = x.length;
for (i=0; i < lgth; i++)
{
if (x.charAt(i) == y)
result = true;
}
return result;
}
function checkPercent(x, y, z)
{
var x; var y; var z; var percent;
percent = (y/100)*x;
if (z == "y")
return (x - percent);
else
return percent;
}
function checkWord(x,y)
{
var x; var y; var spell = true;
if (x != y)
spell = false;
return spell;
}
function buildTable(rows, cols, fill, style)
{
var rows; var cols; var fill; var ranNum;
var i; var j; var style;
document.write("<link href='" + style + "' rel='stylesheet' type='text/css' />");
document.write("<div id='content'><p>&nbsp;</p>");
document.write("<table width = '60%' border = '1' align = 'center' cellpadding = '5' cellspacing = '5'>");
ranNum = (rows + 1) * (cols + 1);
for (i = 0; i < rows; i++)
{
document.write("<tr>");
for (j = 0; j < cols; j++)
{
if (fill == "empty")
document.write("<td width = '" + (1/cols) + "%'><h1>&nbsp;<br /></h1> </td>");
if (fill == "random")
{
entry = parseInt(Math.random()*ranNum)+1;
document.write("<td width = '" + (1/cols) + "%'><h1>" + entry + "</h1></td>");
}
if (fill == "prompt")
{
entry = prompt("Enter a value for the cell in row " + (i + 1) + ", column " + (j + 1));
document.write("<td width = '" + (1/cols) + "%'><p>" + entry + "</p></td>");
}
}
document.write("</tr>");
}
document.write("</table> </div>");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Greg's Gambits | Games Menu</title>
<link href="greg.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="container">
<img src="images/superhero.jpg" class="floatleft" />
<h1 id = "logo"><em>Play A Game</em></h1>
<div style ="clear:both;"></div>
<div id="nav">
<p><a href="index.html">Home</a>
<a href="greg.html">About Greg</a>
<a href="play_games.html">Play a Game</a>
<a href="sign.html">Sign In</a>
<a href="contact.html">Contact Us</a></p>
</div>
<div id="content">
<p>Menu of Available Games </p>
<table width="80%" border="0" cellpadding="5">
<tr>
<td width="50%"><a href="greg_tales.html">Greg's Tales</a> </td>
<td width="50%"><a href ="gregs_fortune.html">Madame Vadoma Sees All</a></td>
</tr>
<tr>
<td width="50%"><a href="greg_encoder.html">The Secret Message Encoder</a> </td>
<td><a href = "greg_battle.html">Battle the Evil Troll</a></td>
</tr>
<tr>
<td><a href="gregs_hangman.html">Play Hangman</a> </td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</div>
<div id="footer">Copyright &copy; 2013 Greg's Gambits<br />
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
</div>
</body>
</html>