diff options
-rw-r--r-- | dprint.json | 7 | ||||
-rw-r--r-- | posts/gert.md | 49 | ||||
-rw-r--r-- | posts/index.md | 49 | ||||
-rw-r--r-- | posts/po4-api.md | 105 | ||||
-rw-r--r-- | posts/po4-voerbak.md | 44 | ||||
-rw-r--r-- | posts/po4.md | 79 |
6 files changed, 138 insertions, 195 deletions
diff --git a/dprint.json b/dprint.json index 6e15825..819abc8 100644 --- a/dprint.json +++ b/dprint.json @@ -8,15 +8,9 @@ "quoteStyle": "preferSingle", "importDeclaration.spaceSurroundingNamedImports": true }, - "markdown": { - "textWrap": "always", - "emphasisKind": "asterisks", - "strongKind": "asterisks" - }, "json": { "lineWidth": 80 }, "includes": [ "**/*.{ts,tsx}", - "**/*.{md}", "**/*.{json}" ], "excludes": [ @@ -26,7 +20,6 @@ ], "plugins": [ "https://plugins.dprint.dev/typescript-0.44.0.wasm", - "https://plugins.dprint.dev/markdown-0.6.2.wasm", "https://plugins.dprint.dev/json-0.10.1.wasm" ] } diff --git a/posts/gert.md b/posts/gert.md index fb121ac..62cc835 100644 --- a/posts/gert.md +++ b/posts/gert.md @@ -1,48 +1,22 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +[meta]: <title> (Loek’s excruciatingly interesting blog) +[meta]: <subtitle> (Loek heeft dit geschreven) +[meta]: <author> (Loek) +[meta]: <date> (March 27 2021) +[meta]: <tags> (banana's, test,gert testing, debug) + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing [Here's a link](https://github.com/lonkaars) ![fonny doge meme big laugh hahaha funni image big fonny me laugh because image fonne](https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fbarkpost-assets.s3.amazonaws.com%2Fwp-content%2Fuploads%2F2013%2F11%2FplainDoge.jpg&f=1&nofb=1) -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing # Here's some hierarchy test @@ -57,3 +31,4 @@ Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing ### subsubsection ### subsubsection + diff --git a/posts/index.md b/posts/index.md index fb121ac..f61a35c 100644 --- a/posts/index.md +++ b/posts/index.md @@ -1,48 +1,22 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +[meta]: <title> (Loek’s excruciatingly interesting blog) +[meta]: <subtitle> (Loek heeft dit geschreven) +[meta]: <author> (Loek) +[meta]: <date> (March 27 2021) +[meta]: <tags> (test, debug) + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing [Here's a link](https://github.com/lonkaars) ![fonny doge meme big laugh hahaha funni image big fonny me laugh because image fonne](https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fbarkpost-assets.s3.amazonaws.com%2Fwp-content%2Fuploads%2F2013%2F11%2FplainDoge.jpg&f=1&nofb=1) -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor -incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat -orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor -aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus -semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo -elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. -Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet -consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. -Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing # Here's some hierarchy test @@ -57,3 +31,4 @@ Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing ### subsubsection ### subsubsection + diff --git a/posts/po4-api.md b/posts/po4-api.md index 487b2d3..0ca148b 100644 --- a/posts/po4-api.md +++ b/posts/po4-api.md @@ -1,61 +1,63 @@ +[meta]: <title> (po connect-4 api readme) +[meta]: <tags> (po4, po-connect-4, api, rest) +[meta]: <date> (April 1 2021) +[meta]: <author> (Loekaars) + # API -This is the subdirectory for the API. You can find the API reference in -[this](https://docs.google.com/spreadsheets/d/1mDN9IUqRIMjr_9RmLxKybjIgVuaUadalmPEFnG-XeJg/edit?usp=sharing) -Google Docs document. +This is the subdirectory for the API. You can find the API reference in [this](https://docs.google.com/spreadsheets/d/1mDN9IUqRIMjr_9RmLxKybjIgVuaUadalmPEFnG-XeJg/edit?usp=sharing) Google Docs document. ## Endpoint reference (WIP) API return type classes are mostly defined in api/api.ts -| endpoint | method | description | parameters | authorization | -| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------- | -| /status | GET | get online user count and active game count | | | -| /auth/login | POST | log in with email or username | | | -| /auth/token | POST | log in using a token (stored as cookie) | | | -| /auth/signup | POST | sign up | | | -| /user/info | GET\|POST | get user info by username or id note: avatar is a uri to a 256x256 .png image | | | -| /user/games | GET\|POST | get games of user | | | -| /user/avatar | GET\|POST | fetch or update avatar note: avatar is a client-resized 256x256 .png base64-encoded image, request returns error when image is not .png or larger than 256x256 | | | -| /user/prefrences | GET\|POST | fetch or change user preferences | | | -| /user/password | POST | update password | | | -| /user/email | POST | update email (token used for authentication if password is undefined) | | | -| /user/username | POST | update username (token used for authentication if password is undefined) | | | -| /user/status | POST | update status | | | -| /user/searchFriends | POST | search user's friend list | | | -| /social/request | POST | send a friend request to a user by user id | | | -| /social/accept | POST | accept a friend request | | | -| /social/remove | POST | remove a friend from your friend list or delete a friend request from a user | | | -| /social/search | POST | search for users by username or status | | | -| /social/block | POST | block a user | | | -| /social/unblock | POST | unblock a user | | | -| /social/list/requests | GET | get a list of unaccepted friend requests | | | -| /social/list/blocks | GET | get a list of blocked people | | | -| /social/list/friends | GET | get a list of your friends | | | -| /game/new | POST | create a new private game | | | -| /game/random | POST | join or create a public game | | | -| /game/info | POST | | | | -| /game/accept | POST | accept game invite or rematch | | | -| /game/spectate | POST | spectate a game by id | | | +endpoint|method|description|parameters|authorization +-|-|-|-|- +/status | GET | get online user count and active game count +/auth/login | POST | log in with email or username +/auth/token | POST | log in using a token (stored as cookie) +/auth/signup | POST | sign up +/user/info | GET\|POST | get user info by username or id note: avatar is a uri to a 256x256 .png image +/user/games | GET\|POST | get games of user +/user/avatar | GET\|POST | fetch or update avatar note: avatar is a client-resized 256x256 .png base64-encoded image, request returns error when image is not .png or larger than 256x256 +/user/prefrences | GET\|POST | fetch or change user preferences +/user/password | POST | update password +/user/email | POST | update email (token used for authentication if password is undefined) +/user/username | POST | update username (token used for authentication if password is undefined) +/user/status | POST | update status +/user/searchFriends | POST | search user's friend list +/social/request | POST | send a friend request to a user by user id +/social/accept | POST | accept a friend request +/social/remove | POST | remove a friend from your friend list or delete a friend request from a user +/social/search | POST | search for users by username or status +/social/block | POST | block a user +/social/unblock | POST | unblock a user +/social/list/requests | GET | get a list of unaccepted friend requests +/social/list/blocks | GET | get a list of blocked people +/social/list/friends | GET | get a list of your friends +/game/new | POST | create a new private game +/game/random | POST | join or create a public game +/game/info | POST | +/game/accept | POST | accept game invite or rematch +/game/spectate | POST | spectate a game by id ## Events These are events that are fired by the socket.io connection -| event | description | data | direction | context | -| --------------------- | ----------------------------------------------------------- | -------------------------------- | --------- | ------- | -| fieldUpdate | recieve new playfield from server | `{ field: string }` | `s -> c` | game | -| turnUpdate | recieve if it's player 1's move | `{ player1: boolean }` | `s -> c` | game | -| gameStart | sent when game starts | `none` | `s -> c` | game | -| finish | sent when game finishes | `none` | `s -> c` | game | -| resign | send to resign, is then forwarded to all subscribed clients | `none` | `s <-> c` | game | -| newMove | send a new move | `{ move: int, game_id: string }` | `s <- c` | game | -| registerGameListener | listen to events for a game | `{ id: string }` | `s <- c` | game | -| incomingFriendRequest | get notified of friend request | `none` | `s -> c` | global | -| changedRelation | get notified of a different relation to someone | `{ id: string }` | `s -> c` | global | +event|description|data|direction|context +-|-|-|-|- +fieldUpdate|recieve new playfield from server|`{ field: string }`|`s -> c`|game +turnUpdate|recieve if it's player 1's move|`{ player1: boolean }`|`s -> c`|game +gameStart|sent when game starts|`none`|`s -> c`|game +finish|sent when game finishes|`none`|`s -> c`|game +resign|send to resign, is then forwarded to all subscribed clients|`none`|`s <-> c`|game +newMove|send a new move|`{ move: int, game_id: string }`|`s <- c`|game +registerGameListener|listen to events for a game|`{ id: string }`|`s <- c`|game +incomingFriendRequest|get notified of friend request|`none`|`s -> c`|global +changedRelation|get notified of a different relation to someone|`{ id: string }`|`s -> c`|global ## How to test API endpoints - ```sh # If you're running the standalone flask server: curl http://localhost:5000/<endpoint> @@ -68,16 +70,10 @@ curl http://localhost:2080/api/<endpoint> Please follow these rules when creating new API endpoints: -1. Endpoints should always return a valid JSON object and an appropriate - [http code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) -2. Endpoints that are in a namespace should get their own directory in this - folder, eg. http://localhost:5000/status is defined in api/status.py, - http://localhost:5000/auth/signup is defined in api/auth/signup.py etc. -3. Endpoints that take data should verify that the data is present and valid, - and return an empty JSON object with http code 400 (bad request) if the data - isn't valid. -4. Endpoints that require database access should get the cursor/connection - object from api/db.py +1. Endpoints should always return a valid JSON object and an appropriate [http code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) +2. Endpoints that are in a namespace should get their own directory in this folder, eg. http://localhost:5000/status is defined in api/status.py, http://localhost:5000/auth/signup is defined in api/auth/signup.py etc. +3. Endpoints that take data should verify that the data is present and valid, and return an empty JSON object with http code 400 (bad request) if the data isn't valid. +4. Endpoints that require database access should get the cursor/connection object from api/db.py ## Example endpoint @@ -106,3 +102,4 @@ dynamic_route = ["/tests", status] # | # namespace (defined in dynamic_route variable) ``` + diff --git a/posts/po4-voerbak.md b/posts/po4-voerbak.md index 74e616b..99759b1 100644 --- a/posts/po4-voerbak.md +++ b/posts/po4-voerbak.md @@ -1,19 +1,21 @@ +[meta]: <title> (po connect-4 voerbak readme) +[meta]: <tags> (po4, po-connect-4, voerbak, c) +[meta]: <date> (April 1 2021) +[meta]: <author> (Loekaars) + # Voerbak -Here's the source for voerbak, this project's connect 4 engine. The name comes -from an abbreviation for the Dutch word for connect 4: Vier Op Een Rij -> VOER + -bak = voerbak +Here's the source for voerbak, this project's connect 4 engine. The name comes from an abbreviation for the Dutch word for connect 4: Vier Op Een Rij -> VOER + bak = voerbak -Voerbak uses a 1-dimensional array for storing the playfield, and it's printed -after every move. The ordering is left to right, then bottom to top: +Voerbak uses a 1-dimensional array for storing the playfield, and it's printed after every move. The ordering is left to right, then bottom to top: -| 35 | 36 | 37 | 38 | 39 | 40 | 41 | -| -- | -- | -- | -- | -- | -- | -- | -| 28 | 29 | 30 | 31 | 32 | 33 | 34 | -| 21 | 22 | 23 | 24 | 25 | 26 | 27 | -| 14 | 15 | 16 | 17 | 18 | 19 | 20 | -| 7 | 8 | 9 | 10 | 11 | 12 | 13 | -| 0 | 1 | 2 | 3 | 4 | 5 | 6 | +35|36|37|38|39|40|41 +-|-|-|-|-|-|- +28|29|30|31|32|33|34 +21|22|23|24|25|26|27 +14|15|16|17|18|19|20 +7|8|9|10|11|12|13 +0|1|2|3|4|5|6 Voerbak is used in this project using api/game/voerbak_connector.py @@ -25,10 +27,9 @@ make ## Input -Voerbak takes moves seperated by newlines from stdin. An example game would look -like this: +Voerbak takes moves seperated by newlines from stdin. An example game would look like this: -```sh +``` sh echo "4,3,3,2,1,2,2,7,1,7,1,7,1" | sed "s/,/\n/g" | ./voerbak # ^ convert "," to newline ``` @@ -48,12 +49,12 @@ message type Message reference: -| type | name | messages | -| ---- | ------ | --------------------------------------------- | -| d | draw | full = board is full | -| e | errors | full = column is full | -| m | move | true | -| w | win | int-int = board indices where 4 was connected | +type|name|messages +-|-|- +d|draw|full = board is full +e|errors|full = column is full +m|move|true|false = if it's player 1's move +w|win|int-int = board indices where 4 was connected ## Command-line arguments @@ -77,3 +78,4 @@ for any corresponding short options. Report bugs to https://github.com/lonkaars/po-4-op-een-rij/. ``` + diff --git a/posts/po4.md b/posts/po4.md index a32331a..c9770dc 100644 --- a/posts/po4.md +++ b/posts/po4.md @@ -1,3 +1,8 @@ +[meta]: <title> (po connect-4 readme) +[meta]: <tags> (po4, po-connect-4, readme, github) +[meta]: <date> (April 1 2021) +[meta]: <author> (Loekaars) + # PO connect-4 ![](./banner.png) @@ -9,8 +14,8 @@ </p> > Some of this project's code is in Dutch (commit messages, documents etc.), -> along with the whole website. This was originally a school project, but I'm -> going to keep maintaining this project during my exams and summer break +along with the whole website. This was originally a school project, but I'm +going to keep maintaining this project during my exams and summer break ## Planned features: @@ -36,8 +41,7 @@ - [NextJS](https://nextjs.org/) for static react pages and html page routing - [socket.io](https://socket.io/) for bidirecitonal communication during a game - [SQLite](https://sqlite.org/index.html) for the database -- [nginx](https://nginx.org/en/) for serving static files generated by nextjs, - caching and reverse proxy +- [nginx](https://nginx.org/en/) for serving static files generated by nextjs, caching and reverse proxy A design prototype of the website can be found on [Figma](https://www.figma.com/file/rTciVQApAe6cwrH1Prl5Wn/4-op-een-rij?node-id=0%3A1). @@ -48,8 +52,8 @@ moving and updating it to be in api/readme.md. ## setup -To set up this project you'll need to install npm and pip dependencies, pull all -git submodules and compile voerbak and the sql extensions. +To set up this project you'll need to install npm and pip dependencies, pull +all git submodules and compile voerbak and the sql extensions. > I haven't figured out how to run this project on Windows, so please install > [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) if you want @@ -66,8 +70,8 @@ To start the setup process you only need to run the following command: ./configure ``` -The script calls sudo and apt install so some password input/manual confirmation -is required, but most of the install should be automated. +The script calls sudo and apt install so some password input/manual +confirmation is required, but most of the install should be automated. ### manual setup (other distro's) @@ -75,44 +79,40 @@ If your disto doesn't use the `apt` package manager, you can still run this project by following these steps: 0. `git clone https://github.com/lonkaars/po-4-op-een-rij` -1. Make sure you have [python](https://python.org/downloads) (with pip and venv) - installed. -2. Make sure you have [nodejs](https://nodejs.org/en/download) (with npm) - installed. +1. Make sure you have [python](https://python.org/downloads) (with pip and venv) installed. +2. Make sure you have [nodejs](https://nodejs.org/en/download) (with npm) installed. 3. Make sure you have [nginx](https://nginx.org/en/) installed. -4. Make sure you have [make](https://www.gnu.org/software/make/) and the gnu c - compilers [gcc](https://gcc.gnu.org/) installed (most distro's will have - these by default). +4. Make sure you have [make](https://www.gnu.org/software/make/) and the gnu c compilers [gcc](https://gcc.gnu.org/) installed (most distro's will have these by default). 5. Install typescript, react-scripts and yarn: - ```sh - npm i -g typescript yarn - ``` + ```sh + npm i -g typescript yarn + ``` 6. Create a new python virtual environment and install pip modules: - ```sh - python -m venv venv - source venv/bin/activate - pip install -r requirements.txt - ``` + ```sh + python -m venv venv + source venv/bin/activate + pip install -r requirements.txt + ``` 7. Install node modules: - ```sh - yarn - ``` + ```sh + yarn + ``` 8. Build voerbak: - ```sh - cd voerbak - make - ``` + ```sh + cd voerbak + make + ``` 9. Download submodules: - ```sh - git submodule init - git submodule update - ``` + ```sh + git submodule init + git submodule update + ``` 10. Initialize database and build SQL extensions: - ```sh - cd database - ./init_db.sh - make - ``` + ```sh + cd database + ./init_db.sh + make + ``` ## How to start @@ -134,3 +134,4 @@ sudo nginx -c $PWD/nginx.conf # this command is also in ./configure sed "s/user nobody/user $(whoami)/" -i nginx.conf ``` + |