Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.80 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. for(int randomValue=(int) Math.round(Math.random()*100), numberGuessed=-1, introMessage=0;
  2.         numberGuessed !=randomValue;
  3.         System.out.println(Integer.toString(introMessage).replace("0", "Pick a number from 1 to 100").replace("2","------")),
  4.                 System.out.println(Integer.toString(introMessage).replace("0","------").replace("2","Not quite there! Your number is " + Integer.toString(Integer.signum(numberGuessed-randomValue)).substring(0,1).replace("1", "over").replace("-", "under") + " the real value")),
  5.                 introMessage=2,numberGuessed=Integer.parseInt((new java.util.Scanner(System.in)).nextLine()),
  6.                 System.out.println(Integer.toString(Integer.signum(numberGuessed - randomValue)).substring(0,1).replace("0", "YOU WIN!").replace("1", "Pick a number from 1 to 100").replace("-", "Pick a number from 1 to 100"))
  7. );