Skip to content

Instantly share code, notes, and snippets.

@ManfredHayes
Created April 26, 2017 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ManfredHayes/3db43b06b14a07fa8ec0c1776c505f62 to your computer and use it in GitHub Desktop.
Save ManfredHayes/3db43b06b14a07fa8ec0c1776c505f62 to your computer and use it in GitHub Desktop.
public char[] pieceGenerator(int difficulty){
char[] piece = new char[3];
Random rng = new Random();
for(int i = 0; i < 3; i++){
int charNum =(int)rng.nextDouble()*difficulty + 61;
char placementChar = (char) charNum;
piece[i] = placementChar;
}
return piece;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment