/**

* @(#)Initial_test.java

*

* Initial_test application

*

* Lazyman method by using 2D array for shits n giggles (also coming back from a roadtrip at 5AM on sunday = RIP BRAIN

* Everything feels surreal because sleep deprivation.

* Halp why keyboard is made of white lines.

*/

import java.util.* ;

import java.awt.Point ;

import java.lang.* ;

public class Initial_test {

public static void main ( String [ ] args ) {

Scanner cheese = new Scanner ( System . in ) ;

ArrayList < String > iono = new ArrayList < String > ( ) ;

ArrayList < yolo > nyet = new ArrayList < yolo > ( ) ;

String rewrite ;

int howLongWillThisGo = 0 ;

boolean mmm = true ;

// Don't even try to read the following code if you value your sanity

while ( mmm == true )

{

System . out . print ( "Input coordinate in (x,y) format pls(type \" stop \" to end): " ) ;

rewrite = cheese. nextLine ( ) ;

if ( rewrite. equalsIgnoreCase ( "stop" ) )

{

mmm = false ;

}

else

{

iono. add ( rewrite ) ;

howLongWillThisGo ++;

}

}

for ( int x = 0 ; x < howLongWillThisGo ; x ++ )

{

String frustration [ ] = iono. get ( x ) . split ( "," ) ;

nyet. add ( new yolo ( Integer . parseInt ( frustration [ 0 ] ) , Integer . parseInt ( frustration [ 1 ] ) ) ) ;

}

System . out . print ( "Type in any x value to find matching y: " ) ;

int typing = cheese. nextInt ( ) ;

String result = "None" ;

for ( int x = 0 ; x < nyet. size ( ) ; x ++ )

{

if ( nyet. get ( x ) . getX ( ) == typing )

{

result = Integer . toString ( nyet. get ( x ) . getY ( ) ) ;

}

}

System . out . println ( "Result: " + result ) ;

//EDIT: WTF THERE WAS A POINT FUNCTION????????? DAMNITTTTTTTTTTTTTTTTTTTTTTTTT

//EDIT2: WHY IS POINT FUNCTION SO FUCKING USELESS WTF

}