Skip to content

al-roberts-computing/tic-tac-toe-fsharp

Repository files navigation

Tic-Tac-Toe in F# (Functional Programming)

Overview

F# is a functional-first programming language, making it ideal for implementing Functional Programming principles / styles. These code files show how F# can be used to make Tic-Tac-Toe in Functional Programming.

Requirements

F# requires the Microsoft .NET framework (SDK) v9.0 to be installed. This can be installed on Ubuntu by the following the instructions at https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-install?tabs=dotnet9&pivots=os-linux-ubuntu-2404, or on Windows at: https://learn.microsoft.com/en-us/dotnet/core/install/windows.

Setup and Execution

  1. Once .NET is installed, run dotnet new console -lang "F#" -o TicTacToeFSharp to setup a new project folder.
  2. Move the F# files into this new directory, including the .fsproj file.
  3. Run dotnet build within the directory, to create the necessary binaries.
  4. Run dotnet run to run the project, using the aforementioned binaries.

Note

If you would like to edit the files, you can edit them in text editors such as VSCode (by installing the 'Ionide for F#' extension), or IDEs including Visual Studios. You may have to re-arrange the order of the files within the F# Solution Explorer, with the dependencies being higher in the hierarchy (as these need to be loaded first). This is because of FSharp's dependency top-down approach.

About

This repository contains Functional Programming-styled code for Tic-Tac-Toe, in F#.

Topics

Resources

License

Stars

Watchers

Forks

Languages