Skip to content

Commit

Permalink
常識
Browse files Browse the repository at this point in the history
  • Loading branch information
sassa7777 committed Jan 28, 2024
1 parent f160849 commit 40d9754
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 8 deletions.
Binary file not shown.
8 changes: 4 additions & 4 deletions othello/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="hako" id="KZh-AK-QLb"/>
</imageView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bLc-DZ-CAJ">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bLc-DZ-CAJ">
<rect key="frame" x="259" y="439" width="277" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="ハコくんオセロ" id="FYm-bR-h7J">
Expand Down Expand Up @@ -755,7 +755,7 @@
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MPx-DE-YD2">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MPx-DE-YD2">
<rect key="frame" x="117" y="209" width="216" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Label" id="a50-gj-vqa">
Expand All @@ -775,7 +775,7 @@
<action selector="tapclose:" target="AIO-dW-Itm" id="yE3-zG-LeJ"/>
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="egp-Lz-xbN">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="egp-Lz-xbN">
<rect key="frame" x="191" y="159" width="68" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Label" id="SDM-Yg-DiY">
Expand Down Expand Up @@ -1523,7 +1523,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="hako" id="c0Y-EB-lNb"/>
</imageView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kdP-cl-HZJ" userLabel="hakotext">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kdP-cl-HZJ" userLabel="hakotext">
<rect key="frame" x="158" y="109" width="286" height="65"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="left" drawsBackground="YES" id="NG6-NI-yb2">
Expand Down
52 changes: 48 additions & 4 deletions othello/evaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
//

int scoreboard[8][8] = {
35, -13, 1, -1, -1, 1, -13, 35,
-13, -15, -3, -3, -3, -3, -15, -13,
35, -12, 1, -1, -1, 1, -12, 35,
-12, -15, -3, -3, -3, -3, -15, -12,
1, -3, 0, -1, -1, 0, -3, 1,
-1, -3, -1, -1, -1, -1, -3, -1,
-1, -3, -1, -1, -1, -1, -3, -1,
1, -3, 0, -1, -1, 0, -3, 1,
-13, -15, -3, -3, -3, -3, -15, -13,
35, -13, 1, -1, -1, 1, -13, 35
-12, -15, -3, -3, -3, -3, -15, -12,
35, -12, 1, -1, -1, 1, -12, 35
};

int score_wing(char board[10][10])
Expand Down Expand Up @@ -285,6 +285,49 @@ int score_badcorner(char board[10][10])
return -block;
}

int score_goodcorner(char board[10][10])
{
int score = 0;
//左上
//白
if(board[1][1] == 2 && board[2][1] == 2) score += 12;
if(board[1][1] == 2 && board[1][2] == 2) score += 12;
if(board[1][1] == 2 && board[2][2] == 2) score += 15;
//黒
if(board[1][1] == 1 && board[2][1] == 1) score -= 12;
if(board[1][1] == 1 && board[1][2] == 1) score -= 12;
if(board[1][1] == 1 && board[2][2] == 1) score -= 15;
//右上
//白
if(board[1][8] == 2 && board[2][8] == 2) score += 12;
if(board[1][8] == 2 && board[1][7] == 2) score += 12;
if(board[1][8] == 2 && board[2][7] == 2) score += 15;
//黒
if(board[1][8] == 1 && board[2][8] == 1) score -= 12;
if(board[1][8] == 1 && board[1][7] == 1) score -= 12;
if(board[1][8] == 1 && board[2][7] == 1) score -= 15;
//左下
//白
if(board[8][1] == 2 && board[7][1] == 2) score += 12;
if(board[8][1] == 2 && board[8][2] == 2) score += 12;
if(board[8][1] == 2 && board[7][2] == 2) score += 15;
//黒
if(board[8][1] == 1 && board[7][1] == 1) score -= 12;
if(board[8][1] == 1 && board[8][2] == 1) score -= 12;
if(board[8][1] == 1 && board[7][2] == 1) score -= 15;
//右下
//白
if(board[8][8] == 2 && board[8][7] == 2) score += 12;
if(board[8][8] == 2 && board[7][8] == 2) score += 12;
if(board[8][8] == 2 && board[7][7] == 2) score += 15;
//黒
if(board[8][8] == 1 && board[8][7] == 1) score -= 12;
if(board[8][8] == 1 && board[7][8] == 1) score -= 12;
if(board[8][8] == 1 && board[7][7] == 1) score -= 15;

return score;
}

int countscore(char board[10][10], int turn, bool canput[10][10])
{
int score = 0;
Expand All @@ -293,6 +336,7 @@ int countscore(char board[10][10], int turn, bool canput[10][10])
{
score += 50*score_countstone(board);
}
score += score_goodcorner(board);
score += score_fixedstone(board);
score += score_stone(board);
score += 4*score_mountain(board);
Expand Down

0 comments on commit 40d9754

Please sign in to comment.