This file contains hidden or 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.Scanner; | |
public class Main { | |
public static int getNumberOfMaxParam(int a, int b, int c) { | |
if (a >= b && a >= c) { | |
return 1; | |
} | |
if (b >= a && b >= c) { |
This file contains hidden or 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.Scanner; | |
class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
String[] input = scanner.nextLine().split("\\s+", 0); | |
boolean result = true; | |
for (int i = 0; i < input.length - 1; i++) { | |
String first = input[i]; | |
String second = input[i + 1]; |
This file contains hidden or 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
package tictactoe; | |
public enum Messages { | |
ASK("Enter cells: "), | |
NOT_FINISHED("Game not finished"), | |
DRAW("Draw"), | |
WINNER("%s wins"), | |
IMPOSSIBLE("Impossible"); | |
String message; | |
Messages(String message) { |
This file contains hidden or 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
package tictactoe; | |
public class TikTakToeGame { | |
private char[][] state; | |
public TikTakToeGame(char[][] initialState) { | |
this.state = initialState; | |
} | |
public String getState() { |
This file contains hidden or 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
package tictactoe; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in).useDelimiter(""); | |
char[][] state = new char[3][3]; | |
int i = 0; | |
int j = 0; |
This file contains hidden or 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
package tictactoe; | |
public class TikTakToeGame { | |
private char[][] state; | |
public TikTakToeGame(char[][] initialState) { | |
this.state = initialState; | |
} | |
public String getState() { |
This file contains hidden or 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
package tictactoe; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in).useDelimiter(""); | |
char[][] state = new char[3][3]; | |
int i = 0; | |
int j = 0; |
This file contains hidden or 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
package tictactoe; | |
public class TikTakToeGame { | |
private char[][] state; | |
public TikTakToeGame() { | |
this.state = new char[][]{ | |
{'X', 'O', 'X'}, | |
{'O', 'X', 'O'}, | |
{'X', 'X', 'O'} |
This file contains hidden or 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
package tictactoe; | |
public class Main { | |
public static void main(String[] args) { | |
TikTakToeGame game = new TikTakToeGame(); | |
System.out.println(game.getState()); | |
} | |
} |
This file contains hidden or 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
enum Currency { | |
USD, | |
EUR, | |
GBP, | |
RUB, | |
UAH, | |
KZT, | |
CAD, | |
JPY, | |
CNY; |