|
|
|
|
Poslao: 26 Okt 2014 18:23
|
offline
- Strog
- Stručni saradnik
Web programiranje
- Bojan Kopanja
- Web & Mobile developer @ ZeusSoftware
- Pridružio: 26 Jul 2003
- Poruke: 2597
- Gde živiš: Stara Pazova
|
Stvarno sjajna igra . Evo i jos jednog resenja:
+ SKYNET - THE CHASMpublic static void main(String args[]) {
Scanner in = new Scanner(System.in);
int R = in.nextInt(); // the length of the road before the gap.
in.nextLine();
int G = in.nextInt(); // the length of the gap.
in.nextLine();
int L = in.nextInt(); // the length of the landing platform.
in.nextLine();
// game loop
while (true) {
int S = in.nextInt();
in.nextLine();
int X = in.nextInt();
in.nextLine();
System.err.println(R);
if(X == R - 1)
System.out.println("JUMP");
else if(X > R - 1)
System.out.println("SLOW");
else if(S == G + 1)
System.out.println("WAIT");
else if(S > G + 1)
System.out.println("SLOW");
else
System.out.println("SPEED");
}
}
|
|
|
|
|
Poslao: 26 Okt 2014 18:59
|
offline
- Strog
- Stručni saradnik
Web programiranje
- Bojan Kopanja
- Web & Mobile developer @ ZeusSoftware
- Pridružio: 26 Jul 2003
- Poruke: 2597
- Gde živiš: Stara Pazova
|
Napisano: 26 Okt 2014 18:46
Ovo na easy je bas pretty easy hehehe, evo ga i + Power of thorpublic static void main(String args[])
{
Scanner in = new Scanner(System.in);
int LX = in.nextInt(); // the X position of the light of power
int LY = in.nextInt(); // the Y position of the light of power
int TX = in.nextInt(); // Thor's starting X position
int TY = in.nextInt(); // Thor's starting Y position
in.nextLine();
// game loop
while (true) {
int E = in.nextInt(); // The level of Thor's remaining energy, representing the number of moves he can still make.
in.nextLine();
String direction = "";
if (TY < LY) {
TY++;
direction = "S";
} else if (TY > LY) {
TY--;
direction = "N";
}
if (TX < LX) {
TX++;
direction += "E";
} else if (TX > LX) {
TX--;
direction += "W";
}
System.out.println(direction);
}
}
Dopuna: 26 Okt 2014 18:59
Hahahahaha, upravo sam otkljucao achievement "Multilinguist", resio sam "Skynet" na "5" razlicitih jezika - Java, C, C++, ObjectiveC i PHP ...
Svelo se na pisanje istog if-a na sintaksi svih 5 jezika... Da ne pricam da je sintaksa 99% ista xD.
|
|
|
|
|
Poslao: 27 Okt 2014 00:35
|
offline
- Srki_82
- Moderator foruma
- Srđan Tot
- Am I evil? I am man, yes I am.
- Pridružio: 12 Jul 2005
- Poruke: 2483
- Gde živiš: Ljubljana
|
Tu je... pogledaj malo bolje
|
|
|
|
|