Pirate Ship I Comments

Comments

  • LOL had to go back to Booleans chapter.... people Booleans is different from booleans, careful when defining your boolean.

  • I tries using only booleans but didn't work for all conditions, the following worked for me.
    if (gold>=pirates &&gold+pirates <100){
    return true;
    }
    else{
    return false;
    }
    }

  • public class Main {

    public static boolean doStuff(int gold, int pirates){
        //your code here
        boolean success = true;
    
        if (gold < pirates)
    
    cont...
  • I had the following it worked.

    my code

  • My solution
    return(!(gold+pirates > 100) && gold >= pirates);

  • Only this works.

    return gold >= pirates && gold+pirates < 101;
    
  • return gold+pirates>100?false:gold>=pirates?true:false;
    works for me

Contact Us
Sign in or email us at [email protected]