1 / 10

ITI0011 - praktikum 2/16

ITI0011 - praktikum 2/16. Ago Luberg. Ülevaade. Esimene kodutöö Vajalikud põhielemendid I kodutöö jaoks STDIO kontroll-struktuurid massiivid Stringid Erindid ( i.k . exception ) Harjutusülesanne. Esimene kodutöö. Trip-traps-trull 5p laud mängija/arvuti käik

kirk-may
Download Presentation

ITI0011 - praktikum 2/16

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ITI0011 - praktikum2/16 Ago Luberg

  2. Ülevaade • Esimene kodutöö • Vajalikud põhielemendid I kodutöö jaoks • STDIO • kontroll-struktuurid • massiivid • Stringid • Erindid (i.k. exception) • Harjutusülesanne

  3. Esimene kodutöö • Trip-traps-trull • 5p • laud • mängija/arvuti käik • tuvastada, kui ei saa enam käia (laud on täis) • +2p • arvuti eelistab teatud käike • programm tuvastab, kui üks mängija on võitnud • +3p • arvuti "strateegia" võitva käigu puhul • kasutaja võitva käigu takistamine

  4. Standard Input/Output (STD IO) • STDIN - Standard Input • STDOUT - Standard Output • STDERR - Standard Error • Redirection • Streams • Buffering

  5. I/O Streams • InputStream • OutputStream • Classhierarchy • Readingstreams • Buffering

  6. Controlstructures • Loops • header/condition • body, block {} • while, dowhile, for • Conditions • ifconditions • switch

  7. Arrays • int[], int[][] • index • 0 ... length() - 1 • Initializing • null • new int[10] • newint[] {1, 2, 3}

  8. Strings • "text" • + • concatenation • "\"escaping\"" • .substring() • .indexOf() • Comparing • == vs .equals()

  9. IOException • Streamerrors • Specialkindofreturnvalue • throw, catch • intheblock • intheheader

  10. Exercise • Userinputsintegersuntil "exit" isentered • All theintegers are storedinanarray • Beforeexit, all thenumbers are printedout • BufferedReaderbr = new BufferedReader(new InputStreamReader(System.in));

More Related