分配名称时井字游戏的语法错误

时间:2019-02-03 16:36:58

标签: python-3.x

因此,我正在为2个玩家的Tic Tac Toe游戏编写python代码,但在为玩家名称分配变量时出现错误。我找不到错误。

@FXML
    void startGame() {
        try{
            Parent root= FXMLLoader.load(getClass().getResource("BindColor.fxml"));

            ControllerBindColors controller = new ControllerBindColors();
            int number = (int)slider.getValue();
            controller.initData(number,selectedRole.getText(),selectedColor.getText());
            Stage toGame = (Stage)startButton.getScene().getWindow();
            toGame.setTitle("Parasite Pip-Boy Bind Color Menu");
            toGame.setScene(new Scene(root, 600, 300));
            toGame.show();
        }catch(IOException e) {
            startButton.setText("Reinstall program. BindColor.fxml is missing or is corrupted. :(");
        }
    }

我一直在说语法错误的n2变量上报错。

任何帮助都是有意义的。

1 个答案:

答案 0 :(得分:0)

尝试一下:

    n1=str(input("Enter Player 1 name"))
    n2=str(input("Enter Player 2 name"))
    b=str(input("Choose your symbol"))