https://github.com/ky28059/data-tty
Game clients for `data.cs.purdue.edu`.
https://github.com/ky28059/data-tty
Last synced: 25 days ago
JSON representation
Game clients for `data.cs.purdue.edu`.
- Host: GitHub
- URL: https://github.com/ky28059/data-tty
- Owner: ky28059
- License: mit
- Created: 2024-10-16T19:09:59.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-13T18:09:00.000Z (7 months ago)
- Last Synced: 2025-03-31T01:31:46.229Z (2 months ago)
- Language: Python
- Size: 47.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# data-tty
`write`-based game clients for `data.cs.purdue.edu`.
### Usage
SSH into `data.cs.purdue.edu` as usual, e.g.
```bash
ssh [username]@data.cs.purdue.edu
```
Then, run
```bash
python3 /homes/tan478/data-tty/client.py [port]
```
to join the game being run on the specified port.
To *host* a game on `data`, clone the repository and mark `client.py` as readable + executable:
```bash
git clone https://github.com/ky28059/data-tty
chmod 755 ./data-tty/client.py
```
Then, you can run a game server on a specific port by running the desired file in `/games`, passing a port as the first
command-line argument (e.g. to run a chat server on port 5003,
```bash
python3 ./data-tty/games/chat.py 5003
```### Motivation
The idea behind this project was to run a multiplayer game on `data.cs.purdue.edu` using only the `write` command.Unfortunately, because scripts cannot programmatically *read* text that was written to a user, client → server
communication still needs to occur over a TCP socket.Still, these games are "server-side rendered" because `client.py` has no logic to display any game state to the
user's terminal; instead, the client sends keypresses and terminal information (e.g. screen size) to the server and the
server renders the game display directly to the client via `write`.