{"id":15096112,"url":"https://github.com/forewing/goldennum","last_synced_at":"2025-04-14T22:15:54.629Z","repository":{"id":38327449,"uuid":"276582875","full_name":"forewing/goldennum","owner":"forewing","description":"A Goldennum Game battleground.","archived":false,"fork":false,"pushed_at":"2023-03-06T00:59:29.000Z","size":317,"stargazers_count":10,"open_issues_count":7,"forks_count":9,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-14T22:15:43.017Z","etag":null,"topics":["bots","educational-game","gin-gonic","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forewing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T07:49:36.000Z","updated_at":"2022-12-27T08:20:54.000Z","dependencies_parsed_at":"2024-06-19T01:41:04.030Z","dependency_job_id":"03048cbf-ccca-4e24-945c-0baaa16279fd","html_url":"https://github.com/forewing/goldennum","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forewing%2Fgoldennum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forewing%2Fgoldennum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forewing%2Fgoldennum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forewing%2Fgoldennum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forewing","download_url":"https://codeload.github.com/forewing/goldennum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968917,"owners_count":21191162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bots","educational-game","gin-gonic","golang"],"created_at":"2024-09-25T15:45:37.227Z","updated_at":"2025-04-14T22:15:54.613Z","avatar_url":"https://github.com/forewing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go! Goldennum!\n\n[![CI](https://github.com/forewing/goldennum/workflows/CI/badge.svg)](https://github.com/forewing/goldennum/actions?query=workflow%3ACI)\n[![Docker](https://github.com/forewing/goldennum/workflows/Docker/badge.svg)](https://hub.docker.com/r/forewing/goldennum)\n[![Go Report Card](https://goreportcard.com/badge/github.com/forewing/goldennum)](https://goreportcard.com/report/github.com/forewing/goldennum)\n\n## Ideas\n\n[MSRA News: Golden Number Game](https://www.msra.cn/zh-cn/news/features/golden-number-game)\n\n## Rules\n\nThere are N players, begin a competition round of Goldennum. Every round, every player submits 2 float numbers in the open interval (0, 100) to the server. At the end of the round, the server will calculate the average of the numbers submitted during this round as AVG. Then the Goldennum of the round is calculated as AVG * 0.618. For every submitted number, if it is the closest number to the Goldennum, the submitter gets N-2 points, if it is the furthest number from the Goldennum, the submitter gets -2 points, otherwise, the submitter gets no points. After the rounds ends, player with the most points wins the game.\n\nFor players, take a look at our [Participation Guide](https://github.com/forewing/goldennum/wiki/Participation-Guide)!\n\n\u003e If you want to host a game but having trouble deploying on your server, feel free to contact me. I am glad to open a lobby on my server for you.\n\n## Preview\n\n![preview](https://user-images.githubusercontent.com/13747187/111075793-92043c00-8524-11eb-8a34-18ae0684a418.jpg)\n\n## Usage\n\nFor detail, you may refer to the wiki pages.\n\n- [Deployment Guide](https://github.com/forewing/goldennum/wiki/Deployment)\n\n- [Configuration Guide](https://github.com/forewing/goldennum/wiki/Configuration)\n\n## Install\n\n### Docker\n\nYou can get the docker image at [forewing/goldennum](https://hub.docker.com/r/forewing/goldennum).\n\nSee [docker-compose.yml](docker-compose.yml) for example config.\n\n### Pre-Built Binary\n\nDownload it from [GitHub Action CI](https://github.com/forewing/goldennum/actions?query=workflow%3ACI+is%3Asuccess), latest successful build is recommended.\n\nOr from [Latest Release](https://github.com/forewing/goldennum/releases/tag/v0.3.8) page.\n\n### Build From Source\n\n\u003e Require Go 1.16+\n\nMake sure you have `GO111MODULE` set to `on`\n\n```\ngo env -w GO111MODULE=on\n```\n\n\u003e You may need to setup [GOPROXY](https://github.com/goproxyio/goproxy) if you live in countries without international network connections.\n\u003e\n\u003e To set it up, simply run `go env -w GOPROXY=https://goproxy.io,direct`.\n\nYou can install with a single command\n\n```\ngo install github.com/forewing/goldennum@latest\n```\n\nOr get the source code and build manually\n\n```\ngit clone https://github.com/forewing/goldennum.git\ncd goldennum\ngo build\n```\n\n## Run\n\n```\n./goldennum -h\nUsage of ./goldennum:\n  -admin string\n        Admin username. (default \"admin\")\n  -base-url string\n        Base URL. If you are using reverse proxy to redirect \"//PUBLIC_HOST/PREFIX/uri\" to \"//REAL_HOST/url\", it should be set to \"/PREFIX\"\n  -bind string\n        Bind address. (default \"0.0.0.0:8080\")\n  -conf string\n        Config file path. If set, load config from file instead.\n  -db-addr string\n        Mysql server address. (default \"localhost:3306\")\n  -db-name string\n        Database name. (default \"goldennum\")\n  -db-pass string\n        Database password. (default \"goldennum\")\n  -db-path string\n        Path to sqlite3 database. (default \"./sqlite3.db\")\n  -db-type string\n        [sqlite3, mysql] (default \"sqlite3\")\n  -db-user string\n        Database username. (default \"goldennum\")\n  -debug\n        Set debug mode.\n  -password string\n        Admin password. Random if empty.\n  -version\n        Display versions.\n```\n\n1. By default, server read all configs from command line flags.\n\n2. If flag `-conf={FILE}` is set, server will load configs from `{FILE}` instead of flags. Refer to `./config.example.yml` for detail.\n\n3. If environment variable `USE_ENV_CONFIG=true` is set, non-empty environment variable will override corresponding fields. Refer to `example.env` for detail.\n\n4. If `password` not set, a safe random token will be used.\n\n## API\n\nPlayers may develop their own AI/Bot to take part in the game, using the API port.\n\n[API Specification](https://github.com/forewing/goldennum/wiki/API-Specification)\n\n## Development Guide\n\nPR welcome!\n\n[Development Guide](https://github.com/forewing/goldennum/wiki/Development-Guide)\n\n## Thanks\n\n- [Nanjing University Microsoft Student Club](https://github.com/njumsc) for supporting this project!\n\n- [Zhanglv0413](https://github.com/Zhanglv0413) for designing the lovely logo!\n\n    [![logo](resources/statics/favicon.ico)](resources/statics/favicon.ico)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforewing%2Fgoldennum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforewing%2Fgoldennum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforewing%2Fgoldennum/lists"}