You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# Minesweeper GO
2
2
A Go implementation of Minesweeper, currently available in terminal. In the future it will also compile for wasm and you can use it in your web projects
The game is published for test on windows now. you can [download](https://github.com/AmirMahdyJebreily/MinesweeperGO/releases/tag/win-test) the .exe or you can build your exe :
5
8
```shell
6
9
git clone https://github.com/AmirMahdyJebreily/MinesweeperGO.git && cd MinesweeperGO
@@ -17,7 +20,7 @@ enjoy the game
17
20
18
21
but in the future you can play in Unix and Windows environments (under the terminal).
19
22
20
-
## Why did I write this code?
23
+
## Why did I write this code? 🤔
21
24
You might ask, "What unemployed programmer would implement such an old and boring game in Go?" But I have to tell you that first, I am not unemployed, and second, this game is not boring. I develop and maintain this codebase for this two reasons.
22
25
23
26
First, many programmers in the 90s had fun making games that ran in terminal or DOS environments. Today, there are many engines for making games that make the programmer's job easier and allow the game developer to focus on the game itself, not on how to present a graphical environment on a particular game console.
@@ -28,7 +31,10 @@ Secondly, I myself wanted to check where exactly Go could be run. I used other l
28
31
.NET runs wherever you can install its runtime, but the .NET runtime is much heavier than Go and cannot be run on every operating system, and for me, Go is a gateway to other operating systems and environments. I'm trying to install old and new operating systems on virtual machines (probably this one I made myself), and run this program on them to see where exactly go can be. I also have a Nano Pi 2 Fire at home, which does the same thing as a Raspberry Pi, but with a bit less capabilities! I've also ported it to different SBCs and maybe even different Micro Controllers to see exactly how far I can push Go. (TinyGo is a compiler that I hope will help me!)
29
32
This page will be updated gradually and I'll upload a YouTube video reporting on this exciting zero!
30
33
31
-
## How do I make one for myself?
34
+
## Why Minesweeper? 💣
35
+
Why not?! It's a logical and engaging game that always tells you that something must have left a mark or this number shouldn't be here! If you like challenging your brain, this game will really entertain you!
36
+
37
+
## How do I make one for myself? 🧑💻🧑💻
32
38
Use the `minesweeperlib` to create your own Minesweeper (as an exercise or to help students, etc.). It's provides just **5 functions** that allow you to create your Minesweeper in any platform (such as a browser):
33
39
34
40
#### **1. The `GetBoard(cols, rows)` function**
@@ -92,6 +98,10 @@ The last function determines the win/loss status. If you have flagged all the bo
92
98
93
99
---
94
100
95
-
## Contribute
101
+
## Why do I write its documentation in detail? 📝
102
+
Because maybe someone will want to help make this repo's mission come true!
103
+
104
+
## Contribute ☕
96
105
- If you can provide fast and efficient ways to implement game logic, fork the repository and get started 👍
97
-
- The game needs to have different themes. Design separate themes for the game 😊
106
+
- The game needs to have different themes. Design separate themes for the game 😊
107
+
- If you can run the game on a platform that you don't think is common, I'd be happy to put the code you wrote for that platform in the cmd directory and submit a Pull Request so I can merge it 📝
Copy file name to clipboardExpand all lines: cmd/wasm/main/main.go
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import (
8
8
9
9
func JS_GetBoard() js.Func {
10
10
var ArgumentError = js.ValueError{
11
-
Method: "[MineSweeperLib_Js_Getboard]: Input arguments are not supported\nplease see documents again at",
11
+
Method: "[minesweeperlib_JS_Getboard]: Input arguments are not supported\nplease see documents again at (https://github.com/AmirMahdyJebreily/MinesweeperGO/tree/main/cmd/wasm/main)",
12
12
Type: types.Int,
13
13
}
14
14
return js.FuncOf(func(this js.Value, args []js.Value) any {
@@ -21,7 +21,17 @@ func JS_GetBoard() js.Func {
21
21
}
22
22
23
23
func JS_GetRandomBombs() js.Func {
24
-
24
+
var ArgumentError = js.ValueError{
25
+
Method: "[minesweeperlib_JS_GetRandomBombs]: Input arguments are not supported\nplease see documents again at (https://github.com/AmirMahdyJebreily/MinesweeperGO/tree/main/cmd/wasm/main)",
26
+
Type: types.Int,
27
+
}
28
+
return js.FuncOf(func(this js.Value, args []js.Value) any {
0 commit comments