Skip to content

kyle-annen/f-sharp-tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

F-Sharp TicTacToe

Setup and suggested tools

Installing F# is straight forward as it is included in Dotnet CLI.

Dotnet CLI is also used for building, dependency management, and for testing. It can be downloaded with Brew/Casks.

Assuming brew is installed:

brew update
brew tap caskroom/cask
brew cask install dotnet-sdk

If you prefer not to use homebrew casks, dotnet-sdk can be downloaded and installed from Microsoft:

https://www.microsoft.com/net/learn/get-started/macos

In terms of IDEs, Visual Studio Mac, Visual Studio Code, and JetBrains Rider are all good.

I prefer Visual Studio Code with the Ionide packages installed, as the type annotations and introspection are top notch.

Visual Studio Code can be installed with brew casks.

brew cask install visual-studio-code

Ionid-fsharp can be installed from the Visual Studio Code command palette.

Launch Command Pallete ⌘ + p

ext install Ionide-fsharp

Playing the game

To play the TicTacToe, from the home directory run:

./play.sh

Testing

NUnit is used for testing. From the root directory of the project run:

./test.sh

Dependencies

There are five dependencies, all used for test driven development, four for NUnit, and one test watcher.

Functional Vs Object Oriented

As with Scala and Ocaml, F# can be written with classes or without, and can have mutation.

I have chosen to only use mutation in testing for mocks. Types and Functions are favored over classes, with name spacing provided by modules.

Where ever possible pattern matching and pipes are favored over if/else blocks, and partial application is kept to a minimum to help convey intent.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published