This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scan=new Scanner(System.in); | |
Random rand=new Random(); | |
final int PLAYER_NUM=2;//何人で遊ぶか? | |
char suffix='A';//名前の最初の文字 | |
int[] playerPoints=new int[PLAYER_NUM];//プレイヤーごとの現在地を保存 | |
char[] playerSuffix=new char[PLAYER_NUM];//プレイヤーごとの名前配列 | |
for(int i=0;i<PLAYER_NUM;i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Main { | |
static final int MIN_NUM=1,MAX_NUM=5; | |
public static void main(String[] args) { | |
Scanner scan=new Scanner(System.in); | |
//comの番号配列を宣言{0,0,0,0,0} | |
int[] comNums=new int[MAX_NUM-MIN_NUM+1]; | |
//comの番号配列に中身を入れる{3,2,5,1,4} | |
init(comNums); | |
//プレイヤーの出した数字を格納していくリスト |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sortArr(int[] arr){ | |
for(int i=0;i<arr.length-1;i++){ | |
int index=new java.util.Random().nextInt(arr.length-i); | |
int temp=arr[index]; | |
arr[index]=arr[arr.length-1-i]; | |
arr[arr.length-1-i]=temp; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "hello"; |