Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public static String Enter(String s1, String s2, String s3, String s4)
  2. {
  3. for (int q = 0; q < 4; q++) {
  4. if (q == 0) {
  5. colors[0][q] = s1;
  6. }
  7. if (q == 1) {
  8. colors[0][q] = s2;
  9. }
  10. if (q == 2) {
  11. colors[0][q] = s3;
  12. }
  13. if (q == 3) {
  14. colors[0][q] = s4;
  15. }
  16. }
  17. for (int i = 0; i < 4; i++) {
  18.  
  19. if (solution[i].equals(colors[0][i])) {
  20. s = "1" + s;
  21. }
  22. else
  23. {
  24.  
  25. for (int j = 0; j < 4; j++)
  26. {
  27. if(colors[0][i].equals(solution[j]))
  28. {
  29. inSolution = true;
  30. }
  31. }
  32.  
  33. if(inSolution == true)
  34. {
  35. s = s + "0";
  36. }
  37. else
  38. {
  39. s = s + "2";
  40. }
  41.  
  42. }
  43. if(colors[0][i].equals("1111"))
  44. {
  45. //something
  46.  
  47. }
  48.  
  49.  
  50.  
  51. }
  52.  
  53. return s;
  54.  
  55. }
  56.  
  57. public static String colors[][] = new String[10][4];
  58. public static String solution[] = new String[4];
  59. public static boolean inSolution = false;
  60. public static String s = "";
Add Comment
Please, Sign In to add comment