Last active
August 29, 2015 14:03
-
-
Save SlayterDev/a44d8ea3787543eaf56f to your computer and use it in GitHub Desktop.
Create a picture
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.Random; | |
| public class TestBed { | |
| public static void main(String[] args) { | |
| // TODO Auto-generated method stub | |
| char[] tokens = {'o', '+', '-', '#'}; // symobols | |
| Random random = new Random(); | |
| System.out.println("---------------"); // top image border | |
| for (int i = 0; i < 10; i++) { | |
| System.out.print('|'); // left border | |
| for (int j = 0; j < 13; j++) { | |
| boolean put = random.nextBoolean(); | |
| if (put) { // place a symbol | |
| int choice = random.nextInt(tokens.length); | |
| System.out.print(tokens[choice]); | |
| } else { // place a space | |
| System.out.print(' '); | |
| } | |
| } | |
| System.out.println("|"); // right border | |
| } | |
| System.out.println("---------------"); // bottom image border | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment