Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yooneet4;
- import java.awt.Color;
- import java.util.Scanner;
- import unit4.gridLib.Grid;
- /**
- *
- *
- */
- public class Yooneet4 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int a = in.nextInt();
- int b = in.nextInt();
- Grid e = new Grid(10,10);
- e.setVisible(true);
- e.setSquareColor(a, b, Color.red);
- }
- }
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yooneet4;
- import java.awt.Color;
- import java.util.Scanner;
- import unit4.gridLib.Grid;
- import java.util.Random;
- /**
- *
- * @author Admin
- */
- public class u2 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- Random rnd = new Random();
- int a = rnd.nextInt(10) + 1;
- Grid e = new Grid(10,20);
- e.setVisible(true);
- for (int i = 0; i<20; i++){
- e.setSquareColor(a, i, Color.yellow);
- }
- }
- }
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yooneet4;
- import java.awt.Color;
- import java.util.Random;
- import java.util.Scanner;
- import unit4.gridLib.Grid;
- /**
- *
- * @author Admin
- */
- public class u3 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- Random rnd = new Random();
- int a = rnd.nextInt(10) + 1;
- Grid e = new Grid(10,20);
- e.setVisible(true);
- for(int i = 0; i< 20; i=i+2){
- e.setSquareColor(a, i, Color.yellow);
- }
- for(int i = 1; i< 20; i=i+2){
- e.setSquareColor(a, i, Color.black);
- }
- }
- }
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yooneet4;
- import java.awt.Color;
- import java.util.Random;
- import java.util.Scanner;
- import unit4.gridLib.Grid;
- /**
- *
- * @author Admin
- */
- public class u4 {
- public static void main(String[] args) {
- Grid e = new Grid(15,15);
- e.setVisible(true);
- int j =15;
- for(int i = 0; i<15; i++){
- e.setSquareColor(i, i, Color.yellow);
- e.setSquareColor(j-1, i, Color.yellow);
- j--;
- }
- }
- }
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yooneet4;
- import java.awt.Color;
- import unit4.gridLib.Grid;
- /**
- *
- * @author Admin
- */
- public class u5 {
- public static void main(String[] args) {
- Grid e = new Grid(15,15);
- e.setVisible(true);
- int j =15;
- for(int i = 0; i<15; i++){
- e.setSquareColor(0, i, Color.yellow);
- e.setSquareColor(i, 0, Color.yellow);
- e.setSquareColor(14, i, Color.yellow);
- e.setSquareColor(i, 14, Color.yellow);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement