Skip to content

Commit

Permalink
feat(minus): add a game that handle substraction
Browse files Browse the repository at this point in the history
  • Loading branch information
mJehanno committed Apr 25, 2024
1 parent 72565bd commit c3aeb04
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: 'mult-game_linux-amd64'
platform: 'linux/amd64'
os: 'ubuntu-latest'
- name: 'mult-game_windows-amd64'
- name: 'mult-game_windows-amd64.exe'
platform: 'windows/amd64'
os: 'windows-latest'

Expand Down
50 changes: 50 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
- go mod tidy
- task build:front

builds:
- goos:
#- CGO_ENABLED=1

- linux
#- windows
#- darwin
goarch:
- "amd64"
ldflags: -w -s -H windowsgui
flags:
- -tags="desktop production"
- -o=/home/egmar/Documents/Projects/mult-game/build/bin/mult-game

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
6 changes: 5 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ tasks:
- ./bump-to.sh {{ .CLI_ARGS }}
- git add .
- git commit --amend --no-edit
- git tag v{{ .CLI_ARGS }}
- git tag v{{ .CLI_ARGS }}
build:front:
cmds:
- npm ci && npm run build
dir: frontend/
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"private": true,
"version": "2.0.2",
"version": "2.1.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/pages/Game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ const router = useRouter();
</script>
<template>
<Game v-if="store.selectedGame !== GameMode.Min" />
<div v-else>
<Message severity="error" >This game is not implemented yet.</Message>
<Button label="back" @click="router.push('/')"/>
</div>
<Game />
</template>
6 changes: 6 additions & 0 deletions frontend/src/stores/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export const useGameStore = defineStore('game', () => {
game.prompt = game.x + " + " + game.y;
game.result = game.x + game.y;
break;
case GameMode.Min:
game.x = generateRandom(5, 15);
game.x = generateRandom(game.y, 20);
game.prompt = game.x + " - " + game.y;
game.result = game.x - game.y;
break;
case GameMode.Mult:
default:
game.prompt = game.x + " X " + game.y;
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
)

var (
current = semver.MustParse("2.0.2")
current = semver.MustParse("2.1.0")
)

type Binder struct {
Expand Down
2 changes: 1 addition & 1 deletion wails.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"info": {
"companyName": "mJehanno",
"productName": "mult-game",
"productVersion": "2.0.2",
"productVersion": "2.1.0",
"copyright": "Copyright @mJehanno",
"comments": "Built using Wails (https://wails.io)"
},
Expand Down

0 comments on commit c3aeb04

Please sign in to comment.