Professional Documents
Culture Documents
This is a game programme in BlueJ background, where one has to enter numbers from 1-10 and
compete with an opponent to reach 100 as quickly as possible. Each number entered will be
summed up to reach 100.
*/
package GAMES;
import java.util.*;
import java.io.*;
class Pogo
if(z++ == 0)
s = 0; c = 1;
if((c =(int)sc.nextDouble()) == 1)
pg.accept(sc);
else if(c == 2)
{System.out.println("\n\n\t\t~~~~~~~*T H A N K\tY O
U*~~~~~~~\n\n\t\t\t\t\t\t\t\t\t\tPRESENTING YOU BUY : S - GAMES"); return;}
main();
System.out.print("\nRule : Your aim is to reach 100 first, by entering any number between 1 to
10.\n\tIf you enter any number outside this range, you will be penalized.\n\nPress 'Enter' to
continue : ");
br.readLine();
switch((int)sc.nextDouble())
case 2: computer(sc);
break;
case 1: humman(sc);
display();
br.readLine();
S1 = sc.next()+sc.nextLine().trim();
S2 = sc.next()+sc.nextLine().trim();
break;
S1 = sc.next()+sc.nextLine().trim();
break;
i = ((s >= 65 && m == 'E') || (s >= 70 && m == 'M') || (s >= 20 && m == 'H'))?hard():((s >= 50
&& m == 'E') || (s >= 40 && m == 'M') || (s >= 0 && m ==
'H'))?medium():(int)((Math.random()*10)+1);
c = (s >= 100)?2:1;
else
else if(c == 2 && S2.charAt(0) == ' ' && (m == 'E' || m == 'M' || m == 'H'))
}
package GAMES;
import java.util.*;
import java.io.*;
class Time
System.out.print(n);
n = "";
sec(Integer.valueOf(n = sts.nextToken()));
if(n.equals(""))
milli(Integer.valueOf(t));
else
milli(Integer.valueOf(sts.nextToken()));
void sec(int s)
s += date.get(Calendar.SECOND);
s -= 60;
while(true)
if(dt.get(Calendar.SECOND) == s)
break;
ms += date.get(Calendar.MILLISECOND);
ms -= 1000;
while(true)
if(dt.get(Calendar.MILLISECOND) == ms)
break;