9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 9 Games of Go
@ 2009-08-31 20:15 Akshat Kumar
  2009-08-31 23:25 ` Fazlul Shahriar
  0 siblings, 1 reply; 5+ messages in thread
From: Akshat Kumar @ 2009-08-31 20:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]

With the hopes of playing Go amongst
fellow Plan 9 users, I've written a little
filesystem[1] which can currently be
used for any two-player turn-based
games.

I'm currently working on Paurea's
wonderful goban code, to implement
support for reading from and writing to
files, so that we have a working
interface to use.
I also have plans to add the same
ability to Mirtchovski's port of GNU Go,
so that the antisocial community can
play amongst themselves (or oneself).

The filesystem is meant to simulate
a proper game server, through basic
file and permissions operations.

Creating a directory in the root of the fs
is equivalent to a "game room". The fs
automatically creates two files: 'W' and
'B' under the newly created dir, which
correspond, respectively, to the positional
data of "white" and "black" players.
The files, as well as the directory, have
uid and gid of the user who created
them. When that user wants to play
against someone, they set the gid of
either 'W' or 'B' to their opponent's uname.
To this effect, both files are mode 464.
Both files block until new data is written.
The fs implements no formatting restrictions
to data -- it is left up to clients to agree on
a format and use it for the duration of a game.
(Oh what fun it might be to map the operations
of a Chess game to that of Go....)
In this way, the fs implements only one real
"rule", which is general enough for any sort of
game (in this class): once either 'W' or 'B' is
written, a "dirty" flag is set on the file, so it
may not again be written to, until the other file
has been written.

There are a few things left to do still, and they
are briefly documented in the NOTES[2] file.

I crave feedback, so please do not hesitate.
Programming suggestions, fs implementations,
and the like, all more than welcome. Privately,
or publicly.


Best,
ak

[1] The source can be found in
/n/sources/contrib/akumar/α/gofs

[2] /n/sources/contrib/akumar/α/gofs/NOTES

For convenience, I've attached just the gofs
source file to this mail. Let me know if this is
undesirable.

[-- Attachment #2: gofs.c.gz --]
[-- Type: application/x-gzip, Size: 4093 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 9 Games of Go
  2009-08-31 20:15 [9fans] 9 Games of Go Akshat Kumar
@ 2009-08-31 23:25 ` Fazlul Shahriar
  2009-09-01  0:25   ` Akshat Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Fazlul Shahriar @ 2009-08-31 23:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

It might be worth the effort to implement Go Text Protocol
(http://www.lysator.liu.se/~gunnar/gtp/), just in case you're having
trouble finding people to play with.

Anyway, nice work.

fhs

2009/8/31 Akshat Kumar <akumar@mail.nanosouffle.net>:
> With the hopes of playing Go amongst
> fellow Plan 9 users, I've written a little
> filesystem[1] which can currently be
> used for any two-player turn-based
> games.
>
> I'm currently working on Paurea's
> wonderful goban code, to implement
> support for reading from and writing to
> files, so that we have a working
> interface to use.
> I also have plans to add the same
> ability to Mirtchovski's port of GNU Go,
> so that the antisocial community can
> play amongst themselves (or oneself).
>
> The filesystem is meant to simulate
> a proper game server, through basic
> file and permissions operations.
>
> Creating a directory in the root of the fs
> is equivalent to a "game room". The fs
> automatically creates two files: 'W' and
> 'B' under the newly created dir, which
> correspond, respectively, to the positional
> data of "white" and "black" players.
> The files, as well as the directory, have
> uid and gid of the user who created
> them. When that user wants to play
> against someone, they set the gid of
> either 'W' or 'B' to their opponent's uname.
> To this effect, both files are mode 464.
> Both files block until new data is written.
> The fs implements no formatting restrictions
> to data -- it is left up to clients to agree on
> a format and use it for the duration of a game.
> (Oh what fun it might be to map the operations
> of a Chess game to that of Go....)
> In this way, the fs implements only one real
> "rule", which is general enough for any sort of
> game (in this class): once either 'W' or 'B' is
> written, a "dirty" flag is set on the file, so it
> may not again be written to, until the other file
> has been written.
>
> There are a few things left to do still, and they
> are briefly documented in the NOTES[2] file.
>
> I crave feedback, so please do not hesitate.
> Programming suggestions, fs implementations,
> and the like, all more than welcome. Privately,
> or publicly.
>
>
> Best,
> ak
>
> [1] The source can be found in
> /n/sources/contrib/akumar/α/gofs
>
> [2] /n/sources/contrib/akumar/α/gofs/NOTES
>
> For convenience, I've attached just the gofs
> source file to this mail. Let me know if this is
> undesirable.
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 9 Games of Go
  2009-08-31 23:25 ` Fazlul Shahriar
@ 2009-09-01  0:25   ` Akshat Kumar
  2009-09-18 23:49     ` Akshat Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Akshat Kumar @ 2009-09-01  0:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> It might be worth the effort to implement Go Text Protocol
> (http://www.lysator.liu.se/~gunnar/gtp/), just in case you're having
> trouble finding people to play with.

No, I'm going for world domination. Starting with the local Go group.

The fileserver is meant for Plan 9 communications, and is left open
to serve any interface that provides a two-player turn-based game.
This includes Go, Chess, Checkers, and whatever else. After the
rudimentary interface is provided by an application (i.e., a board
or an automated engine), the only thing required to make it
networked is to decide on a format and use it to read/write on
files served by the fs (and handle gid permissions, if one wants).
To this effect, I've added *no* Go primitives or specifications to
the filesystem, and don't intend to do so in the future.

I never found it interesting to play with random people on the
internet, anyway. This is at least a dreidel roll away from
being the roll of dice.

> Anyway, nice work.

Thanks,
ak



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 9 Games of Go
  2009-09-01  0:25   ` Akshat Kumar
@ 2009-09-18 23:49     ` Akshat Kumar
  2009-09-19  0:13       ` Akshat Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Akshat Kumar @ 2009-09-18 23:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I've made updates to gofs[1], documented in NOTES.

Goban[2] is a graphical interface to gofs, for playing
the game of Go with a partner, or just by oneself.

The original goban was written by Gorka, and I've
made quite a few changes to it, to be able to play
from gofs.

Usage:
Simply running `gofs` creates /srv/gofs. To use,
just mount: `mount /srv/gofs /n/gofs` and create
a game with mkdir under /n/gofs. To play against a
partner, the gid of their respective player file must
be the uname with which they connected to gofs[3]
(i.e.: `chgrp joe /n/gofs/mine/W` to play against
user joe as white, in the game named "mine").
(As documented in an earlier post, this auto-
matically creates game files: /n/gofs/mine/^(W B).)

usage: goban [-v] [-p B|W] [-m mtpt] game
-v is verbose flag, for debugging only (it disrupts the
GUI). If specified, the -p flag determines which 'colour'
the user is playing as: B for black and W for white.
These correspond to the game files in gofs. If
unspecified, the user plays as both, black and white.
The -m flag specifies the mountpoint, which by
default is: /n/gofs. 'game' specifies the game under
the gofs mountpoint.

Game play in goban is simple: button one on the
board produces a white stone and button two
produces a black stone. Button three counts
black and white territories.


BUGS
gofs:
There is no authentication or checking that unames
are unique. This means that two users with the same
unames can control each other's games. To be fixed
soon.

goban:
Perhaps too many to name at this time.
'undo' functionality is only partially implemented, in that
it does not at all work with gofs (the current implementation
is left unchanged from the old, single-player goban).
There is no 'pass' functionality yet. Players will just have
to rely on their psychic abilities.
The application has not been thoroughly tested. Counting
territories should work, but there are no guarantees.

I leave it to the users to do further testing. I'll have a
game server open for Plan 9 users to connect to via
srv(4) at nanosouffle.net port 2479, soon.


Best,
ak

P.S.: BUGS: This mail was written too quickly, without
attention to detail.

[1] New location: /n/sources/contrib/akumar/igo/gofs
[2] /n/sources/contrib/akumar/igo/goban
[3] See BUGS, "gofs"



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 9 Games of Go
  2009-09-18 23:49     ` Akshat Kumar
@ 2009-09-19  0:13       ` Akshat Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Akshat Kumar @ 2009-09-19  0:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Quick update:

-r flag has been added to goban, to simply
watch ongoing games.

Further updates will probably go in a man
page that I haven't yet created.
Just so I don't spam 9fans.


Best,
ak



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-19  0:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-31 20:15 [9fans] 9 Games of Go Akshat Kumar
2009-08-31 23:25 ` Fazlul Shahriar
2009-09-01  0:25   ` Akshat Kumar
2009-09-18 23:49     ` Akshat Kumar
2009-09-19  0:13       ` Akshat Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).