Ecere Software
/
sdk
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compiler/libec: (#341, #351, #644, #771) Improved enum type matching and type handlin...
[sdk]
/
samples
/
games
/
othello
/
othello.ec
diff --git
a/samples/games/othello/othello.ec
b/samples/games/othello/othello.ec
index
04888c6
..
d952df3
100644
(file)
--- a/
samples/games/othello/othello.ec
+++ b/
samples/games/othello/othello.ec
@@
-121,8
+121,8
@@
class Othello : Window
{
board[sy][sx] = color;
this.numChips[color] += numChips + 1;
{
board[sy][sx] = color;
this.numChips[color] += numChips + 1;
- this.numChips[
1-color
] -= numChips;
- this.turn =
1-color
;
+ this.numChips[
color^1
] -= numChips;
+ this.turn =
color^1
;
if(!PossibleMove())
{
if(!PossibleMove())
{
@@
-329,7
+329,7
@@
class Othello : Window
surface.SetForeground(tomato);
if(gameOver)
surface.WriteTextf(100, 420, "GAME OVER");
surface.SetForeground(tomato);
if(gameOver)
surface.WriteTextf(100, 420, "GAME OVER");
- else if(!local && sockets[
1-turn
])
+ else if(!local && sockets[
turn^1
])
surface.WriteTextf(50, 420, "It is your turn to move.");
}
}
surface.WriteTextf(50, 420, "It is your turn to move.");
}
}
@@
-345,7
+345,7
@@
class Othello : Window
x /= WIDTH;
y /= HEIGHT;
x /= WIDTH;
y /= HEIGHT;
- if(sockets[
1-turn
] || local)
+ if(sockets[
turn^1
] || local)
{
if(x < NUM_COLUMNS && y < NUM_ROWS && board[y][x] == empty)
{
{
if(x < NUM_COLUMNS && y < NUM_ROWS && board[y][x] == empty)
{
@@
-353,7
+353,7
@@
class Othello : Window
if(TurnChips(x, y, turn, 1))
{
if(!local)
if(TurnChips(x, y, turn, 1))
{
if(!local)
- sockets[
1-packet.player
].Send((byte *)&packet, sizeof(OPacket));
+ sockets[
packet.player^1
].Send((byte *)&packet, sizeof(OPacket));
}
}
}
}
}
}