Commit 6d93eff5 authored by Weber Rodolphe's avatar Weber Rodolphe

add yams template

parent a48a2192
/**
* @file Yams.java
* @author WEBER rodolphe <rodolphe.weber@univ-orleans.fr>
* @version 1.0
* @date 24/07/2021
* @mainpage
* @section LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @section DESCRIPTION
*
* This java file represents a java lab for the 4th year students of Polytech Orleans.
*/
import java.util.Scanner;
public class Yams{
static void clearScreen(){
System.out.print("\033[H\033[2J");
System.out.flush();
}
public static void main(String[] args) {
YamsDices myDice5 = new YamsDices();
SheetPlayer player1 = new SheetPlayer("Player1");
Scanner sc= new Scanner(System.in);
int figureIndex;
for (int idx=0 ; idx<13 ; idx++){
clearScreen();
player1.printScore();
myDice5.rollYams("12345");//1st roll
myDice5.printYams();
myDice5.rollYams(myDice5.askDice(sc));//2nd roll
clearScreen();
player1.printScore();
myDice5.printYams();
figureIndex=player1.askFigure(sc);
myDice5.rollYams(myDice5.askDice(sc));//3rd roll
player1.updateScoring(figureIndex , myDice5.getScore(figureIndex));//
clearScreen();
player1.printScore();
myDice5.printYams();
System.out.print("press return");
sc.nextLine(); //wait
}
sc.close();
System.out.println("Player1, your final score : "+ player1.totalScore());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment