1 / 3

CST223 Week 5 Lab

CST223 Week 5 Lab. F# Demo Create a project in F# Interactive F#. F#: Some Tips. Variables are non-mutable by default: let x = 3 let x = 5 <= redefinition error x = 5 <= not allowed Can override it with mutable keyboard

tia
Télécharger la présentation

CST223 Week 5 Lab

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. CST223 Week 5 Lab • F# Demo • Create a project in F# • Interactive F#

  2. F#: Some Tips • Variables are non-mutable by default: • let x = 3 • let x = 5 <= redefinition error • x = 5 <= not allowed • Can override it with mutable keyboard • let mutable board = [[‘-’;’-’;’-’];[‘-’;’-’;’-’];[‘-’;’-’;’-’]] • board <- (PlacePiece 1 1 ‘X’)

  3. F#: Some tips • Formatting does seem to matter. • Single statement (if/then/else) needs to be on one line. • Use printfn to print out results or use interactive F# window to see results

More Related