
import java.util.*;


public class HelpBestOfTexas
{

  // Recursion
  
  public static void printHello(int x)
  {
    if (x == 5)
      return;
    System.out.println("Hello");
    printHello(x+1);
  }
  
  
  // ***** main method *****
  public static void main(String[] arguments)
  {
      System.out.printf("Hello Best of Texas\n");
      System.out.printf("%n");
      System.out.printf("\n");

      System.out.println("Some things to Know");
      System.out.printf("\n");
      System.out.println("Order of Operations * / % (LR)  + - (LR)");
      System.out.printf("\n");
      System.out.println("Know your mods and divs!!!");
      System.out.printf("\n");
      System.out.println("Arrays get initialize to 0, 0.0, false, null, etc.");
      System.out.printf("\n");
      System.out.println("Scope errors.  { }");
      System.out.printf("\n");
      System.out.println("bitshift Operations  ");
      System.out.println("12 >> 1 = " + (12 >> 1));
      System.out.println("12 >> 2 = " + (12 >> 2));
      System.out.println("12 << 1 = " + (12 << 1));
      System.out.println("12 << 2 = " + (12 << 2));
      System.out.println("12 << 3 = " + (12 << 3));
      System.out.printf("\n");
      System.out.println("bitwise Operations & ^ |  ");
      System.out.println("12 & 8 = " + (12 & 8));
      System.out.println("12 ^ 8 = " + (12 ^ 8));
      System.out.println("12 | 8 = " + (12 | 8));
      System.out.printf("\n");
      System.out.println("boolean Operations !  &&  ^  || ");
      System.out.println("true  && true   = " + (true && true));
      System.out.println("true  && false  = " + (true && false));
      System.out.println("false && true   = " + (false && true));
      System.out.println("false && false  = " + (false && false));
      System.out.printf("\n");

      int x = 2;
      x *= 2.6; // NOT the same as  x = x * 2.6;
      System.out.println("int x = 2;  x *= 2.6;   x=" + x);
      System.out.printf("\n");      
      System.out.printf("\n");
      
      System.out.println("Boolean Tables ! && ^ ||");
      System.out.println("A shortcut - Short Circuiting");
      System.out.println("true || false && true = " + (true || false && true));
      
      System.out.println("Printing a backslash \\");
      System.out.println("Printing a double quote \"");
      System.out.println("Printing a single quote \' or '");
      System.out.printf("\n");
      
// binary, octal, and hex numbers
      System.out.println("Binary, Octal, and Hex Numbers");
      int binaryNum = 0b001101; // 13   8 4 2 1
      System.out.println("0b001101 = 1x8 + 1x4 + 0x2 + 1x1 = " + binaryNum);
      
      int octalNum = 026; // 22  64 8 1
      System.out.println("026 = 2x8 + 6x1 = " + octalNum);
      
      int hexNum = 0x2f; // 47    256 16 1  (use 0-9, a,b,c,d,e,f)
      System.out.println("0x2f = 2x16 + 15x1 = " + hexNum);
      System.out.printf("\n");
      
      
      System.out.println("+=  -=  *=  /=  %=");
      System.out.printf("\n");
      int a = 3;
      a *= 2 + 8;  // this is like  a = a * (2+8);
      System.out.println("a *= 2 + 8, same as a = a * (2+8) = " + a);
      
      String s = "zabczdefzghiz"; // trailing split symbols do nothing
      String [] array = s.split("[z]");  // use "z" or "[z]" or "[za]" z or a
      System.out.println(Arrays.toString(array));
      
      Scanner scan = new Scanner(s);
      scan.useDelimiter("[z]");
      while (scan.hasNext())
      {
        System.out.print(scan.next() + ", ");
      }
      System.out.println();
      System.out.println();
      
      scan = new Scanner("78, 88, 97");
      scan.useDelimiter(", ");
      while (scan.hasNext())
      {
        System.out.print(scan.nextInt() + ", ");
      }
      System.out.println();
      System.out.println();
      
      System.out.println("Math.ceil(?)  Math.floor(?)  Math.round(?)");
      System.out.println("Math.abs(?)  (overloaded)");
      System.out.println("Math.power(a,b)");
      System.out.println("Math.min(a,b)  Math.max(a,b)  (overloaded)");
      System.out.println("Math.ceil(2.7)="+Math.ceil(2.7));
      System.out.println("Math.ceil(2.5)="+Math.ceil(2.5));
      System.out.println("Math.ceil(2.1)="+Math.ceil(2.1));
      System.out.println("Math.ceil(2)="+Math.ceil(2));
      System.out.println("Math.ceil(-2.7)="+Math.ceil(-2.7));
      System.out.println("Math.ceil(-2.5)="+Math.ceil(-2.5));
      System.out.println("Math.ceil(-2.1)="+Math.ceil(-2.1));
      System.out.println();
                           
      
      System.out.println("Math.floor(?)");
      System.out.println("Math.floor(2.7)="+Math.floor(2.7));
      System.out.println("Math.floor(2.5)="+Math.floor(2.5));
      System.out.println("Math.floor(2.1)="+Math.floor(2.1));
      System.out.println("Math.floor(2)="+Math.floor(2));
      System.out.println("Math.floor(-2.7)="+Math.floor(-2.7));
      System.out.println("Math.floor(-2.5)="+Math.floor(-2.5));
      System.out.println("Math.floor(-2.1)="+Math.floor(-2.1));
      System.out.println();
                           
      System.out.println("Math.round(?)");
      System.out.println("Math.round(2.7)="+Math.round(2.7));
      System.out.println("Math.round(2.5)="+Math.round(2.5));
      System.out.println("Math.round(2.1)="+Math.round(2.1));
      System.out.println("Math.round(2)="+Math.round(2));
      System.out.println("Math.round(-2.7)="+Math.round(-2.7));
      System.out.println("Math.round(-2.5)="+Math.round(-2.5));
      System.out.println("Math.round(-2.1)="+Math.round(-2.1));
      System.out.println();
      
      System.out.println("Mods and Divs");
      System.out.println(" 14 % 4  ="+(14 % 4));
      System.out.println(" 14 % -4 ="+(14 % -4));
      System.out.println("-14 % 4  ="+(-14 % 4));
      System.out.println("-14 % -4 ="+(-14 % -4));
      
      

      printHello(1);
      
      System.out.println();
      System.out.println();
      
      
  }



} // end of class HelpArrayList




