-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Umbenennung "Vier in einer Reihe" nach "Vierer-Reihe"
- Loading branch information
1 parent
7e49eef
commit ea5f79c
Showing
14 changed files
with
286 additions
and
194 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.05 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/circle-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.26 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/circle-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.28 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/circle-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.84 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/circle-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.12 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/circle-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.9 KB
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/frameset_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+317 Bytes
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/space_162x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+324 Bytes
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/64px/space_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,7 +157,7 @@ | |
</head> | ||
<body> | ||
|
||
<h1>Vier Gewinnt gegen Alexa</h1> | ||
<h1>Verier-Reihe gegen Alexa</h1> | ||
|
||
<p> | ||
<table> | ||
|
245 changes: 245 additions & 0 deletions
245
EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/play2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="cache-control" content="no-cache" /> | ||
<meta http-equiv="pragma" content="no-cache" /> | ||
<script type="text/javascript" src="../js/jquery.js"></script> | ||
<script type="text/javascript"> | ||
|
||
var col_name=['gray', 'red', 'yellow', '#C00000', '#c0c000']; | ||
var col_name=['64px/circle-0.png', '64px/circle-1.png', '64px/circle-2.png', '64px/circle-3.png', '64px/circle-4.png']; | ||
var stopreload=false; | ||
var cnt=0; | ||
var aiLevel; | ||
var version = -1; | ||
|
||
function reset() | ||
{ | ||
$.ajax({ | ||
type: 'post', | ||
url: '../rest/c4', | ||
data: { | ||
cmd: 'clearSession' | ||
}, | ||
success: function (response) { | ||
window.location="index.html"; | ||
} | ||
}); | ||
} | ||
|
||
function getGameData() | ||
{ | ||
$.ajax({ | ||
type: 'post', | ||
url: '../rest/c4', | ||
data: { | ||
cmd: 'clientGetGameData' | ||
}, | ||
success: function (response) { | ||
cnt = cnt + 1 | ||
document.getElementById( "cnt" ).value=cnt; | ||
if (response.version) { | ||
version = response.version; | ||
} | ||
if (response.aiLevel) { | ||
aiLevel = response.aiLevel; | ||
document.getElementById( "txt_aiLevel" ).innerHTML='Spielstärke(AI): '+aiLevel; | ||
} | ||
if (response.movesCount) { | ||
document.getElementById( "txt_movesCount" ).innerHTML='Zug: '+response.movesCount; | ||
} | ||
if (response.fieldView && response.fieldView.field) { | ||
setFieldColors(response.fieldView.field); | ||
} | ||
if (response.code !== S_OK) { | ||
stopreload = true; | ||
setTimeout(reset, 15000); | ||
} | ||
|
||
}, | ||
error: function (jqXHR, exception) { | ||
var msg = ''; | ||
if (jqXHR.status === 0) { | ||
msg = 'Not connect.\n Verify Network.'; | ||
} else if (jqXHR.status == 404) { | ||
msg = 'Requested page not found. [404]'; | ||
} else if (jqXHR.status == 500) { | ||
msg = 'Internal Server Error [500].'; | ||
} else if (exception === 'parsererror') { | ||
msg = 'Requested JSON parse failed.'; | ||
} else if (exception === 'timeout') { | ||
msg = 'Time out error.'; | ||
} else if (exception === 'abort') { | ||
msg = 'Ajax request aborted.'; | ||
} else { | ||
msg = 'Uncaught Error.\n' + jqXHR.responseText; | ||
} | ||
alert(msg); | ||
} | ||
}); | ||
} | ||
|
||
function loaddata() | ||
{ | ||
$.ajax({ | ||
type: 'post', | ||
url: '../rest/c4', | ||
data: { | ||
cmd: 'hasChanges', | ||
param1: version | ||
}, | ||
success: function (response) { | ||
cnt = cnt + 1 | ||
document.getElementById( "cnt" ).value=cnt; | ||
if (response.code === "S_CHANGES_EXIST") { | ||
setTimeout(getGameData, 1); | ||
} | ||
else if (response.code === "E_UNKNOWN_GAMEID") { | ||
stopreload = true; | ||
setTimeout(reset, 15000); | ||
} | ||
}, | ||
error: function (jqXHR, exception) { | ||
var msg = ''; | ||
if (jqXHR.status === 0) { | ||
msg = 'Not connect.\n Verify Network.'; | ||
} else if (jqXHR.status == 404) { | ||
msg = 'Requested page not found. [404]'; | ||
} else if (jqXHR.status == 500) { | ||
msg = 'Internal Server Error [500].'; | ||
} else if (exception === 'parsererror') { | ||
msg = 'Requested JSON parse failed.'; | ||
} else if (exception === 'timeout') { | ||
msg = 'Time out error.'; | ||
} else if (exception === 'abort') { | ||
msg = 'Ajax request aborted.'; | ||
} else { | ||
msg = 'Uncaught Error.\n' + jqXHR.responseText; | ||
} | ||
alert(msg); | ||
} | ||
}); | ||
if (!stopreload) { | ||
setTimeout(loaddata, 1000); | ||
} | ||
} | ||
|
||
|
||
|
||
function setFieldColors(field) { | ||
for (var y = 0; y < 6; y++) { | ||
for (var x = 0; x < 7; x++) { | ||
var i = x+7*(5-y); | ||
var box=document.getElementById( 'box_'+i ); | ||
box.bgColor = col_name[field[y][x]]; | ||
var img=document.getElementById( 'img_'+i ); | ||
img.src = src_name[field[y][x]]; | ||
} | ||
} | ||
} | ||
|
||
|
||
function startload() | ||
{ | ||
if (stopreload) { | ||
stopreload=false; | ||
setTimeout(loaddata, 1000); | ||
} | ||
} | ||
|
||
function stopload() | ||
{ | ||
stopreload=true; | ||
} | ||
|
||
// setTimeout(loaddata, 1000); | ||
|
||
|
||
</script> | ||
|
||
</head> | ||
<body> | ||
|
||
<h1>Vierer-Reihe gegen Alexa</h1> | ||
|
||
<p> | ||
<table> | ||
<tr><td id="txt_aiLevel"> </td></tr> | ||
<tr><td id="txt_movesCount"> </td></tr> | ||
</table> | ||
</p> | ||
|
||
<table><tr><td> | ||
|
||
<table> | ||
|
||
<p> | ||
<img width="64px" height="64px" id="img_35" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_36" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_37" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_38" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_39" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_40" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_41" src="64px/circle-0.png"/> <br> | ||
<img width="64px" height="64px" id="img_28" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_29" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_30" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_31" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_32" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_33" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_34" src="64px/circle-0.png"/> <br> | ||
<img width="64px" height="64px" id="img_21" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_22" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_23" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_24" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_25" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_26" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_27" src="64px/circle-0.png"/> <br> | ||
<img width="64px" height="64px" id="img_14" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_15" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_16" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_17" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_18" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_19" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_20" src="64px/circle-0.png"/> <br> | ||
<img width="64px" height="64px" id="img_7" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_8" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_9" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_10" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_11" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_12" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_13" src="64px/circle-0.png"/> <br> | ||
<img width="64px" height="64px" id="img_0" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_1" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_2" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_3" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_3" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_5" src="64px/circle-0.png"/><img width="64px" height="64px" id="img_6" src="64px/circle-0.png"/> <br> | ||
</p> | ||
|
||
<p> | ||
<table><tr> | ||
<td><input type="button" onclick="startload();" name="start" value="start"></td> | ||
<td><input type="button" onclick="stopload();" name="stop" value="stop"></td> | ||
<td><input type="button" onclick="reset();" name="reset" value="reset"></td> | ||
<td><input type="text" name="cnt" id="cnt"></td> | ||
</tr></table> | ||
</p> | ||
|
||
|
||
<p> | ||
<table> | ||
<tr> <td align="center">1</td> <td align="center">2</td> <td align="center">3</td> <td align="center">4</td> <td align="center">5</td> <td align="center">6</td> <td align="center">7</td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_35" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_36" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_37" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_38" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_39" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_40" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_41" bgcolor="gray"> </td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_28" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_29" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_30" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_31" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_32" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_33" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_34" bgcolor="gray"> </td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_21" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_22" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_23" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_24" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_25" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_26" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_27" bgcolor="gray"> </td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_14" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_15" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_16" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_17" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_18" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_19" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_20" bgcolor="gray"> </td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_7" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_8" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_9" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_10" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_11" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_12" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_13" bgcolor="gray"> </td> </tr> | ||
<tr> <td width="50px" height="50px" id="box_0" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_1" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_2" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_3" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_4" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_5" bgcolor="gray"> </td> <td width="50px" height="50px" id="box_6" bgcolor="gray"> </td> </tr> | ||
</table> | ||
</p> | ||
|
||
</td><td> | ||
|
||
<br> | ||
<br> | ||
<br> | ||
<br> | ||
|
||
<p> | ||
Um einen Zug zu machen sage welche Reihe (1..7) du wählst: | ||
<code><pre> | ||
"Ich werfe in Reihe ..." | ||
</pre></code> | ||
</p> | ||
|
||
<p> | ||
Soll Alexa anfangen, dann sage: | ||
<code><pre> | ||
"Du darfst anfangen" | ||
</pre></code> | ||
</p> | ||
|
||
<p> | ||
Um die Spielstärke (1..7) zu ändern sage: | ||
<code><pre> | ||
"Setze die Spielstärke auf ..." | ||
</pre></code> | ||
</p> | ||
|
||
<p> | ||
Um ein neues Spiel zu beginnen sage: | ||
<code><pre> | ||
"Starte ein neues Spiel" | ||
</pre></code> | ||
</p> | ||
|
||
</td></tr></table> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.