Skip to content

Commit

Permalink
Umbenennung "Vier in einer Reihe" nach "Vierer-Reihe"
Browse files Browse the repository at this point in the history
  • Loading branch information
ferenc-hechler committed Dec 5, 2017
1 parent 7e49eef commit ea5f79c
Show file tree
Hide file tree
Showing 14 changed files with 286 additions and 194 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Vier in einer Reihe gegen Alexa</title>
<title>Vierer-Reihe gegen Alexa</title>
<meta charset="UTF-8">
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
Expand Down Expand Up @@ -45,7 +45,7 @@
if (response.code === "S_OK") {
document.getElementById( "imageFile" ).src="tiere/" + response.imageName + ".jpg";
document.getElementById( "imageText" ).innerHTML="Ich sehe "+ response.einText +" \"" + response.imageText + "\"";
document.getElementById( "imageText2" ).innerHTML="\"Alexa sage 'Vier in einer Reihe' ich sehe "+ response.einText +" \"" + response.imageText + "\"";
document.getElementById( "imageText2" ).innerHTML="\"Alexa sage 'Vierer-Reihe' ich sehe "+ response.einText +" \"" + response.imageText + "\"";
}
else if (response.code === "S_ACTIVATED") {
stopload();
Expand Down Expand Up @@ -105,7 +105,7 @@
</head>
<body>

<h1>Vier in einer Reihe gegen Alexa Startseite</h1>
<h1>Vierer-Reihe gegen Alexa Startseite</h1>

<p>
Du bist noch nicht verbunden mit Deiner Alexa. <br>
Expand All @@ -118,7 +118,7 @@ <h1>Vier in einer Reihe gegen Alexa Startseite</h1>

<p>Sage
<code><pre>
"Alexa starte 'Vier in einer Reihe'"
"Alexa starte 'Vierer-Reihe'"
</pre></code>
und befolge die Anweisungen, bis Du gefragt wirst, in welche Reihe Du wirfst.
</p>
Expand All @@ -131,9 +131,9 @@ <h1>Vier in einer Reihe gegen Alexa Startseite</h1>
</p>

<p>
Oder starte 'Vier in einer Reihe' unter Angabe des Tierbildes:
Oder starte 'Vierer-Reihe' unter Angabe des Tierbildes:
<code><pre id="imageText2">
"Alexa, sage 'Vier in einer Reihe' ich sehe ein ?"
"Alexa, sage 'Vierer-Reihe' ich sehe ein ?"
</pre></code>
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</head>
<body>

<h1>Vier Gewinnt gegen Alexa</h1>
<h1>Verier-Reihe gegen Alexa</h1>

<p>
<table>
Expand Down
245 changes: 245 additions & 0 deletions EchoShowJava/ConnFourGameRestService/src/main/webapp/c4/play2.html
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&auml;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">&nbsp;</td></tr>
<tr><td id="txt_movesCount">&nbsp;</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">&nbsp;</td> <td width="50px" height="50px" id="box_36" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_37" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_38" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_39" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_40" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_41" bgcolor="gray">&nbsp;</td> </tr>
<tr> <td width="50px" height="50px" id="box_28" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_29" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_30" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_31" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_32" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_33" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_34" bgcolor="gray">&nbsp;</td> </tr>
<tr> <td width="50px" height="50px" id="box_21" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_22" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_23" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_24" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_25" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_26" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_27" bgcolor="gray">&nbsp;</td> </tr>
<tr> <td width="50px" height="50px" id="box_14" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_15" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_16" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_17" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_18" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_19" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_20" bgcolor="gray">&nbsp;</td> </tr>
<tr> <td width="50px" height="50px" id="box_7" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_8" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_9" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_10" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_11" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_12" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_13" bgcolor="gray">&nbsp;</td> </tr>
<tr> <td width="50px" height="50px" id="box_0" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_1" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_2" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_3" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_4" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_5" bgcolor="gray">&nbsp;</td> <td width="50px" height="50px" id="box_6" bgcolor="gray">&nbsp;</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>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<body>

<h1>Vier in einer Reihe gegen Alexa</h1>
<h1>Vierer-Reihe gegen Alexa</h1>

<p>Es ist ein Timeout aufgetreten. Bitte versuche es noch einmal: <a href="index.html">restart</a></p>

Expand Down
Loading

0 comments on commit ea5f79c

Please sign in to comment.