Advertisement
Parasect

Untitled

Sep 1st, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. package yooneet4;
  8. import java.awt.Color;
  9. import java.util.Scanner;
  10. import unit4.gridLib.Grid;
  11. /**
  12. *
  13. *
  14. */
  15. public class Yooneet4 {
  16. public static void main(String[] args) {
  17. Scanner in = new Scanner(System.in);
  18. int a = in.nextInt();
  19. int b = in.nextInt();
  20. Grid e = new Grid(10,10);
  21. e.setVisible(true);
  22. e.setSquareColor(a, b, Color.red);
  23.  
  24.  
  25. }
  26. }
  27. /*
  28. * To change this license header, choose License Headers in Project Properties.
  29. * To change this template file, choose Tools | Templates
  30. * and open the template in the editor.
  31. */
  32.  
  33. package yooneet4;
  34.  
  35. import java.awt.Color;
  36. import java.util.Scanner;
  37. import unit4.gridLib.Grid;
  38. import java.util.Random;
  39. /**
  40. *
  41. * @author Admin
  42. */
  43. public class u2 {
  44. public static void main(String[] args) {
  45. Scanner in = new Scanner(System.in);
  46. Random rnd = new Random();
  47. int a = rnd.nextInt(10) + 1;
  48. Grid e = new Grid(10,20);
  49. e.setVisible(true);
  50. for (int i = 0; i<20; i++){
  51. e.setSquareColor(a, i, Color.yellow);
  52. }
  53.  
  54. }
  55. }
  56. /*
  57. * To change this license header, choose License Headers in Project Properties.
  58. * To change this template file, choose Tools | Templates
  59. * and open the template in the editor.
  60. */
  61.  
  62. package yooneet4;
  63.  
  64. import java.awt.Color;
  65. import java.util.Random;
  66. import java.util.Scanner;
  67. import unit4.gridLib.Grid;
  68.  
  69. /**
  70. *
  71. * @author Admin
  72. */
  73. public class u3 {
  74. public static void main(String[] args) {
  75. Scanner in = new Scanner(System.in);
  76. Random rnd = new Random();
  77. int a = rnd.nextInt(10) + 1;
  78. Grid e = new Grid(10,20);
  79. e.setVisible(true);
  80. for(int i = 0; i< 20; i=i+2){
  81. e.setSquareColor(a, i, Color.yellow);
  82. }
  83. for(int i = 1; i< 20; i=i+2){
  84. e.setSquareColor(a, i, Color.black);
  85. }
  86.  
  87.  
  88. }
  89. }
  90. /*
  91. * To change this license header, choose License Headers in Project Properties.
  92. * To change this template file, choose Tools | Templates
  93. * and open the template in the editor.
  94. */
  95.  
  96. package yooneet4;
  97.  
  98. import java.awt.Color;
  99. import java.util.Random;
  100. import java.util.Scanner;
  101. import unit4.gridLib.Grid;
  102.  
  103. /**
  104. *
  105. * @author Admin
  106. */
  107. public class u4 {
  108. public static void main(String[] args) {
  109.  
  110. Grid e = new Grid(15,15);
  111. e.setVisible(true);
  112. int j =15;
  113. for(int i = 0; i<15; i++){
  114. e.setSquareColor(i, i, Color.yellow);
  115. e.setSquareColor(j-1, i, Color.yellow);
  116. j--;
  117. }
  118.  
  119.  
  120. }
  121. }
  122. /*
  123. * To change this license header, choose License Headers in Project Properties.
  124. * To change this template file, choose Tools | Templates
  125. * and open the template in the editor.
  126. */
  127.  
  128. package yooneet4;
  129.  
  130. import java.awt.Color;
  131. import unit4.gridLib.Grid;
  132.  
  133. /**
  134. *
  135. * @author Admin
  136. */
  137. public class u5 {
  138. public static void main(String[] args) {
  139. Grid e = new Grid(15,15);
  140. e.setVisible(true);
  141. int j =15;
  142. for(int i = 0; i<15; i++){
  143. e.setSquareColor(0, i, Color.yellow);
  144. e.setSquareColor(i, 0, Color.yellow);
  145. e.setSquareColor(14, i, Color.yellow);
  146. e.setSquareColor(i, 14, Color.yellow);
  147. }
  148.  
  149. }
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement