- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
protected boolean valid_move(int from, int to, int aBoard[], int colorfor) {
if(plainType(colorfor) == userColor) {
return (to>=0 && to<=35 && from >=0 && from<=35 && plainType(aBoard[from])==colorfor && aBoard[to]==emptyType
&& ((from-to == 4 || from-to==5)
|| ((from-to == 10 && plainType(aBoard[from-5])==oppositeType(colorfor))
|| (from-to == 8 && plainType(aBoard[from-4])==oppositeType(colorfor)))
|| (aBoard[from]==kingType(colorfor)
&& ((to-from == 4 || to-from==5)
|| ((to-from == 10 && plainType(aBoard[from+5])==oppositeType(colorfor))
|| (to-from == 8 && plainType(aBoard[from+4])==oppositeType(colorfor)))))));
}
else {
return (to>=0 && to<=35 && from >=0 && from<=35 && plainType(aBoard[from])==colorfor && aBoard[to]==emptyType
&& ((to-from == 4 || to-from==5)
|| ((to-from == 10 && plainType(aBoard[from+5])==oppositeType(colorfor))
|| (to-from == 8 && plainType(aBoard[from+4])==oppositeType(colorfor)))
|| (aBoard[from]==kingType(colorfor)
&& ((from-to == 4 || from-to==5)
|| ((from-to == 10 && plainType(aBoard[from-5])==oppositeType(colorfor))
|| (from-to == 8 && plainType(aBoard[from-4])==oppositeType(colorfor))))))); // =)))))
}
}
https://github.com/haiming020/BBS-AKB48/blob/master/src/Checkers.java
Dummy00001 02.11.2014 20:17 # −1
zadrot 06.11.2014 00:39 # 0
Dummy00001 06.11.2014 00:42 # 0
официально: http://en.wikipedia.org/wiki/AKB48
48 "девствениц" танцуют и поют. отаку... делают то что делают отаку.
bormand 06.11.2014 06:15 # 0
Lokich 14.11.2014 17:24 # 0