-
Notifications
You must be signed in to change notification settings - Fork 0
/
ACSL3_abc15_SM.java
94 lines (84 loc) · 2.33 KB
/
ACSL3_abc15_SM.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class ACSL3_abc15_SM {
/*public static String enter_x (String[] input, char[][] grid) //Conversion method
{
int val = 0;
int row = 0;
int col = 0;
for (int i = 0; i < 4; i++) {
val = Integer.parseInt(input[i]);
System.out.println(val);
row = val/6;
col = val%6;
//System.out.print("row: "+ row + " AND col" + col);
String str = Character.toString(grid[row][col]);
//grid[row][col] = str.replace(str, 'X');
}
//enter_hints(input, grid);
return "";
}
public static String enter_hints (String[] input, char[][] grid) //Conversion method
{
int clue = Integer.parseInt(input[4]);
for (int i = 5; i < (5 + (2*clue)); i++) {
int val = Integer.parseInt(input[i+1]);
int row = val/6;
int col = val%6;
grid[row][col] = input[i].charAt(0);
if (col==0){
if(grid[row][col] != 'X'){
col+=1;
}
grid[row][col] = input[i].charAt(0);
}
else if (col==5){
if(grid[row][col] != 'X')
{ col-=1;
}
grid[row][col] = input[i].charAt(0);
}
else if (row==0){
if(grid[row][col] != 'X'){ row+=1; }
grid[row][col] = input[i].charAt(0);
}
else if (row==5){
if(grid[row][col] != 'X'){
row-=1; }
grid[row][col] = input[i].charAt(0);
}
i+=2;
}
for (int i = 0; i<4; i++){
for (int j = 0; j < 4; j++) {
System.out.println(grid[i][j]);
}
}
return "";
}
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String[] answer = {"ABCBACCBACAB", "ACBBACBCACAB", "BACACBACBCBA", "ABCCABABCBCA", "ABCCABBCABCA"};
for (int i = 0; i < 5; i++) {
//Declarations
String[] input = scan.nextLine().split(", "); //stores input
char[][] board = {
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '.', '.', '.', '.'}};
/*for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board.length; j++) {
System.out.print(board[i][j]);
}
}*/
//enter_x(input, board);
System.out.println(answer[i]);
}
}
}