#C++でオセロを作っています。
関数の順番を変えてみたりしたのですが、ビルドエラーがでて改善しません。
どういう風に組むかなどは組みながら考えています。なので無計画です。
回答よろしくお願いします。
- .cpp(18): error C3861: 'input_kannsuu_x': 識別子が見つかりませんでした
- .cpp(35): error C3861: 'input_kannsuu_y': 識別子が見つかりませんでした
C++
1#include "pch.h" 2#include <iostream> 3 4using namespace std; 5 6#define WHITE -1 7#define NONE 0 8#define BLACK 1 9 10#define MASU 8 11 12int board[8][8]; 13 14int filter_x(int input_x) { 15 if (input_x <= 0 || input_x > 8) { 16 cout << "もう一回入力してください\n"; 17 input_kannsuu_x(input_x); 18 } 19 else { 20 return input_x; 21 } 22} 23 24int input_kannsuu_x(int input_x) { 25 cout << "x軸入力 : "; cin >> input_x; 26 filter_x(input_x); 27 return 0; 28} 29 30 31int filter_y(int input_y) { 32 if (input_y <= 0 || input_y > 8) { 33 cout << "もう一回入力してください\n"; 34 input_kannsuu_y(input_y); 35 } 36 else { 37 return 0; 38 } 39} 40 41int input_kannsuu_y(int input_y) { 42 cout << "y軸入力 : "; cin >> input_y; 43 filter_y(input_y); 44 return 0; 45} 46 47 48 49/* 石を表示 */ 50int display(int(*board)[8]) { 51 std::system("cls"); //画面をクリア 52 for (int i = 1; i <= MASU; i++) { 53 for (int j = 1; j <= MASU; j++) { 54 if (board[i][j] == WHITE) { 55 cout << "〇"; 56 } 57 else if (board[i][j] == NONE) { 58 cout << "□"; 59 } 60 else if (board[i][j] == BLACK) { 61 cout << "●"; 62 } 63 } 64 cout << "\n"; 65 } 66 return board[8][8]; 67} 68 69 /* 石の初期位置 */ 70 int setting(int(*board)[8]) { 71 board[8][8] = { NONE }; 72 board[4][4] = WHITE ; 73 board[4][5] = BLACK ; 74 board[5][4] = BLACK ; 75 board[5][5] = WHITE ; 76 77 78 display(board); 79 return 0; 80 } 81 82 83 84int main() { 85//int board[8][8]; 86 int input_x; 87 int input_y; 88 setting(board); 89 90 do { 91 display(board); 92 cout << "\n0で終了\n"; 93 input_kannsuu_x(input_x); 94 input_kannsuu_y(input_y); 95 96 } while (input_x != 0); 97 98} 99

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/05 05:42