Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,017 members, 7,849,098 topics. Date: Monday, 03 June 2024 at 02:36 PM

Simple Java Challenge - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Simple Java Challenge (1400 Views)

Simple Java Calculator Code. (2) (3) (4)

(1) (Reply) (Go Down)

Simple Java Challenge by Slyr0x: 11:27am On May 15, 2016
Hey guys,

I came across this challenge and thought to share.

Challenge question : What is the frame?

import java.util.Random;
import java.util.Scanner;


public class PlsHalp {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);

int i = s.nextInt();
args = new String[i];
for(int x = i-1; x >= 0; x--)
args[x] = s.nextLine();

String tot = "";
for(String str: args)
tot += str;

if(tot.equals("my feet smell and nose runs"wink)
System.out.println("Use knee on frame: " + (args[0] + args[2] + args[4] + args[6]).replace(" ", ""wink.hashCode());
}
}
Re: Simple Java Challenge by HouseOfBalloons(f): 12:24pm On May 15, 2016
Slyr0x:
Hey guys,

I came across this challenge and thought to share.

Challenge question : What is the frame?

import java.util.Random;
import java.util.Scanner;


public class PlsHalp {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);

int i = s.nextInt();
args = new String[i];
for(int x = i-1; x >= 0; x--)
args[x] = s.nextLine();

String tot = "";
for(String str: args)
tot += str;

if(tot.equals("my feet smell and nose runs"wink)
System.out.println("Use knee on frame: " + (args[0] + args[2] + args[4] + args[6]).replace(" ", ""wink.hashCode());
}
}

Frame could be anything, depends on how the strings are inputted into args. There are a lot of combinations you could use to get tot

1 Like

Re: Simple Java Challenge by HouseOfBalloons(f): 12:28pm On May 15, 2016
Also, it's bad practice to overwrite args even if you don't use command line arguments in the program
Re: Simple Java Challenge by Nobody: 1:15pm On May 15, 2016
@op, i don't know that you are on this world, heard you have travelled to outer-space on a NASAA MISSION!
Re: Simple Java Challenge by Nobody: 3:21pm On May 15, 2016
String Str = new String("what is the frame" );

System.out.println("The frame is :" + Str.hashCode() );
}
the frame is 175788836
Re: Simple Java Challenge by Nobody: 4:46pm On May 15, 2016
HOPE I AM RIGHT

**Modified**
i think i found a bug.. i used args[3] instead of args[2]. i can't rectify it now

Re: Simple Java Challenge by quadness(m): 5:15pm On May 15, 2016
What the name of the app you used.... Wanna download it for my phone cool
Re: Simple Java Challenge by Nobody: 5:34pm On May 15, 2016
@crotonite, i love programmers with fuccking sense of humours, i think this has killed the gaddamn quiz!!

1 Like

Re: Simple Java Challenge by Nobody: 7:57pm On May 15, 2016
quadness:
What the name of the app you used.... Wanna download it for my phone cool

AIDE
Re: Simple Java Challenge by Slyr0x: 8:40pm On May 15, 2016
crotonite:
HOPE I AM RIGHT

**Modified**
i think i found a bug.. i used args[3] instead of args[2]. i can't rectify it now

Wrong
Re: Simple Java Challenge by Nobody: 8:42pm On May 15, 2016
Is wrong keh?
Re: Simple Java Challenge by Nobody: 8:45pm On May 15, 2016
Slyr0x:

Wrong
wtf! can u explain the question a little bit more.
Re: Simple Java Challenge by Nobody: 8:48pm On May 15, 2016
Slyr0x:


Wrong
I know the answers are numbers .
Re: Simple Java Challenge by Nobody: 9:23pm On May 15, 2016
Slyr0x:


Wrong

hw about this time around?
frame is 'my0smell0nose'.

Note: i made a little change to ....replace(" ", ""+"".hashcode()) b4 it compiled.

Re: Simple Java Challenge by Slyr0x: 9:37pm On May 15, 2016
^^

The answer is a number that starts with 132.................

Use the hashcode() :-)

(1) (Reply)

Few Android Command For You App Or Game: Market Details / Is Airtime Payment The Solution For In App Purchases? / Get Your Complete Web Development/android Programming Videos Cheap

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.