Guess The Number

Introduction

This is a program that I wrote that will have you think of a number from 1 to 63, and it will ask six questions to determine what your number is. There are two versions: one written in Java and the other written in C#. Both are the same.

 

Download

The zip file containing the binaries and source code can be found here.

 

Running The Program

Prerequisites

If you want to run the Java version, make sure you have Java 8 or later installed. It can be downloaded from Oracle or The Eclipse Foundation.

 

You can check your java version with the following command via the command-line (Terminal in Linux/macOS or PowerShell/Command Prompt/Windows Terminal in Windows):

java -version

 

To run the .NET (C#) version, you will need the .NET 8 Runtime (Linux & macOS) or the .NET 8 Desktop Runtime (Windows).

 

To see if the .NET runtime is installed, use the command:

 which dotnet (Linux and macOS)

or

which.exe dotnet (Windows).

 

To check the .NET version, use the following command (all platforms):

dotnet –list-runtimes

 

The .NET runtime is available from Microsoft for Windows, Linux, and macOS (Intel[x64] and Apple Silicon[arm64])

 

Java Instructions

·      Open Command Prompt/PowerShell/Windows Terminal (Windows) or the Terminal (Linux & macOS) and navigate to the src > java directory

o   Examples (modify based on where you extracted the zip file, if necessary)

§  Linux & macOS: cd ~/Downloads/GuessTheNumber/bin/java

§  Windows: cd ~\Downloads\GuessTheNUmber\bin\java

·      Run the following command:

o   java -jar GuessTheNumber.jar

.NET Instructions

·      Open Command Prompt/PowerShell/Windows Terminal (Windows) or the Terminal (Linux & macOS) and navigate to the src > dotnet directory for your OS

o   Examples (modify based on where you extracted the zip file, if necessary)

§  Windows: cd ~\Downloads\GuessTheNumber\bin\dotnet\Windows

§  Linux: cd ~/Downloads/GuessTheNumber/bin/dotnet/Linux

§  macOS: cd ~/Downloads/GuessTheNumber/bin/dotnet/macOS

·      Run the following command:

o   Windows: .\GuessTheNumber

o   Linux & macOS: ./GuessTheNumber