This is a normal sbt project. You can compile code with sbt compile
, run it with sbt run
, and sbt console
will start a Scala 3 REPL.
For more information on the sbt-dotty plugin, see the scala3-example-project.
These are for Windows; Linux and MacOS should be similar/easier.
- Download and install
AdoptOpenJDK
Version 11 at https://adoptopenjdk.net/ Make sure to choose the options to add it toPATH
and setJAVA_HOME
.
- Download and install
JetBrains IntelliJ IDEA
at https://www.jetbrains.com/idea/
- Reboot.
- Download and install
sbt
version 1.5.4 or later (the version is important! It won't work otherwise) at https://www.scala-sbt.org/download.html (you need the.msi
installer for Windows).
- Launch IntelliJ, to go
Plugins
and install theScala
plugin.
- Restart IntelliJ.
- Go to IntelliJ Settings,
Build, Execution and Deployment/Build Tools/sbt
and point it to yourAdoptOpenJDK
andsbt
installations:
- Download the repository zip file:
- Extract it to
C:\scala3-simple-wordgame-master
.
- In IntelliJ, click "Open" and navigate to the
build.sbt
file:
- Choose "Open as Project":
- Choose to "Trust":
- Now wait for about 5 minutes.
- Eventually it will finish.
- Open "Terminal" and type
sbt
. Then typecompile
.
- Type
test
to run the tests.
- Type
run
to play the game!
Need to wrap the interactive portions of the game using the IO
Monad. (scalaz
or cats
maybe?)
Try to get rid of var
, mutation, and replace while
loops with recursion if possible.
Handle file operations with Using
so that even in case of failure the file gets closed (similar to Python's with ... as ...
syntax).