-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README files at each implementation
- Loading branch information
Showing
7 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## C# implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install dotnet-sdk-8.0 | ||
``` | ||
|
||
### Build | ||
|
||
```shell | ||
dotnet build --configuration Release queens.csproj | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens.jar [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# bin/Release/net8.0/queens 1024 | ||
Queen 1: square 492 | ||
Queen 2: square 294 | ||
(...) | ||
Queen 1023: square 612 | ||
Queen 1024: square 498 | ||
Solved in 1024 steps. Time: 137 ms. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## C++ implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install g++ make | ||
``` | ||
|
||
### Build | ||
|
||
```shell | ||
make | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# ./queens 1024 | ||
Queen 1: square 492 | ||
Queen 2: square 294 | ||
(...) | ||
Queen 1023: square 873 | ||
Queen 1024: square 179 | ||
Steps: 19019 | ||
Discards: 906012 | ||
Time: 476.74 ms. | ||
Performance: 39 steps/ms. | ||
1900 discards/ms. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## Go implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install golang | ||
``` | ||
|
||
### Build | ||
|
||
```shell | ||
go build | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# ./queens 1024 | ||
[0] 338 | ||
[1] 591 | ||
(...) | ||
[1022] 155 | ||
[1023] 790 | ||
Steps: 1051 | ||
Discards: 750108 | ||
Time: 43.254331ms | ||
Performance: 24 steps/ms | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## JavaScript implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install nodejs | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens.js [-h] [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-h</dt> | ||
<dd>Print help.</dd> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# java -jar queens.jar 1024 | ||
Queen 1: square 172 | ||
Queen 2: square 1003 | ||
(...) | ||
Queen 1023: square 288 | ||
Queen 1024: square 347 | ||
Solved in 1020 steps. Time: 180.78 ms. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## Java implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install openjdk-19-jdk-headless | ||
``` | ||
|
||
### Build | ||
|
||
```shell | ||
make | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens.jar [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# java -jar queens.jar 1024 | ||
Queen 1: square 492 | ||
Queen 2: square 294 | ||
(...) | ||
Queen 1023: square 647 | ||
Queen 1024: square 955 | ||
Solved in 1142 steps. Time: 92 ms. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## PHP implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install php | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens.php [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# php queens.php 256 | ||
Queen 1: square 172 | ||
Queen 2: square 1003 | ||
(...) | ||
Queen 255: square 45 | ||
Queen 256: square 174 | ||
Solved in 5106 steps. Time: 445.57 ms. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# N-Queens problem using backtracking and CS | ||
|
||
## Python implementation | ||
|
||
### Set up (Ubuntu 22.04) | ||
|
||
```shell | ||
apt install python3 | ||
``` | ||
|
||
### Syntax | ||
|
||
``` | ||
queens.py [-test] [SIZE] | ||
``` | ||
|
||
<dl> | ||
<dt>-test</dt> | ||
<dd>Enable test output.</dd> | ||
<dt>SIZE</dt> | ||
<dd>Length of the chess.</dd> | ||
</dl> | ||
|
||
### Example | ||
|
||
``` | ||
# ./queens.py 512 | ||
Queen 1: square 172 | ||
Queen 2: square 1003 | ||
(...) | ||
Queen 511: square 1 | ||
Queen 512: square 1 | ||
Solved in 1591 steps. Time: 1241.388 ms. | ||
``` |