Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanlking/scribble-battleships
Battleships game written in PureScript communicating following a Scribble protocol
https://github.com/jonathanlking/scribble-battleships
Last synced: 13 days ago
JSON representation
Battleships game written in PureScript communicating following a Scribble protocol
- Host: GitHub
- URL: https://github.com/jonathanlking/scribble-battleships
- Owner: jonathanlking
- License: bsd-3-clause
- Created: 2019-01-06T13:33:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-12T00:31:41.000Z (over 4 years ago)
- Last Synced: 2024-04-15T02:58:49.855Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 688 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scribble Battleships
This is based on the [Purescript-Concur + Webpack starter pack](https://github.com/ajnsit/purescript-concur-webpack-starter)
## Usage
### Get the `purescript-scribble` and `scribble-java` dependencies
> git submodule update --init --recursive
### Generate the Battleships protocol
**This step is only required if you make changes to the protocol!**
First build the Scribble tool
> docker build -t scribble-java scribble-java
Out protocol is described in `Game.scr`
> docker run -v `pwd`:/repo scribble-java -d /repo/web/src/ /repo/Game.scr -api-ps BattleShips
## Server
> stack build
Start the Battleships game server
> stack exec server
## Web
### Build Purescript code
> yarn
> spago build
### Run Dev Server
> yarn start
## Hot code reload with purescript code
At the end of the previous command, you will have a development server
which will watch for changes, and automatically reload the web page.
This mechanism only works with JS changes.However, in practice, your IDE should automatically recompile Purescript to
Javascript on every change, which will be picked up by the development server.
So you get immediate recompilation even with Purescript.### Build production artifacts
> yarn build