HOW_TO_RUN_THE_GAMES.md
The games in this repository have been translated into a number of different languages. How to run them depends on the target language.
The best cross-platform method for running the csharp examples is with the dotnet command-line tool. This can be downloaded for MacOS, Windows and Linux from dotnet.microsoft.com.
From there, the program can be run by
dotnet runAlternatively, for non-dotnet compatible translations, you will need Visual Studio which can be used to both open the project and run the example.
.csproj or .sln fileRun from within the Visual Studio IDEThe Java translations can be run via the command line or from an IDE such as Eclipse or IntelJ
To run from the command line, you will need a Java SDK (eg. Oracle JDK or Open JDK).
javac:
**```python javac ```** AceyDuceyGame.javajava:
java AceyDuceyGameor if you are using JDK11 or later you can now execute a self contained java file that has a main method directly with java <filename>.java.
There are two ways of javascript implementations:
The html examples can be run from within your web browser. Simply open the corresponding .html file from your web browser.
Some games are implemented as a node.js script. In this case there is no *.html file in the folder.
cd basic-computer-games).node 78_Sine_Wave/javascript/sinewave.mjs).Hint: Normally javascript files have a *.js extension. We are using *.mjs to let node know , that we are using ES modules instead of CommonJS.
Kotlin programs are compiled with the Kotlin compiler, and run with the java runtime, just like java programs.
In addition to the java runtime you will need the kotlinc compiler, which can be installed using these instructions.
kotlinc:
kotlinc AceyDuceyGame.kt -include-runtime -d AceyDuceyGame.jarjava:
java -jar AceyDuceyGame.jarThe pascal examples can be run using Free Pascal. Additionally, .lsi project files can be opened with the Lazarus Project IDE.
The pascal examples include both _simple (single-file) and_o**bject-oriented (in the /object-pascaldirectories) examples.
fpc command.
fpc amazing.pasThe perl translations can be run using a perl interpreter (a copy can be downloaded from perl.org) if not already installed.
perl command.
perl aceyducey.plThe python translations can be run from the command line by using the py interpreter. If not already installed, a copy can be downloaded from python.org for Windows, MacOS and Linux.
py or python interpreter (depending on your python version).
py acey_ducey_oo.pypython aceyducey.pyNote
{
"MD013": false
}
Some translations include multiple versions for python, such as acey ducey which features versions for Python 2 (aceyducey.py) and Python 3 (acey_ducey.py) as well as an extra object-oriented version (acey_ducey_oo.py).
You can manage and use different versions of python with pip.
If you don't already have a ruby interpreter, you can download it from the ruby project site.
ruby tool.
ruby aceyducey.rbFollow the same steps as for the csharp translations. This can be run with dotnet or Visual Studio.
If you don't already have Rust on your computer, you can follow the instruction on Rust Book
cargo run