Squares - new game using Brython

85 views
Skip to first unread message

Andy Lewis

unread,
Jan 27, 2016, 4:01:51 PM1/27/16
to brython
Hi

Just to let you know I have added a new game to my site, which runs using Brython.  It's called Squares, and I originally invented it over 30 years ago, to play on a board made of card with real plastic counters.  Then I made a computer version...

I recently found in a very old folder on my current computer a file dated 16th October 1985, written to run on a Research Machines 286 (in text mode).  Then I found the 1994 version, written in Visual Basic 3 (so now you can click with a mouse!!)  So I thought, it's time for a revival - let's make an online version.  So here it is:

http://mathsanswers.org.uk/games/squares/

I hope you like it - level 1 is very easy, but level 3 is quite hard to beat - it is still using the same algorithm to work out the best move as it was in 1985...

Thanks,

Andy

André

unread,
Jan 27, 2016, 8:01:08 PM1/27/16
to brython


On Wednesday, 27 January 2016 17:01:51 UTC-4, Andy Lewis wrote:
Hi

Just to let you know I have added a new game to my site, which runs using Brython.  It's called Squares, and I originally invented it over 30 years ago, to play on a board made of card with real plastic counters.  Then I made a computer version...

I recently found in a very old folder on my current computer a file dated 16th October 1985, written to run on a Research Machines 286 (in text mode).  Then I found the 1994 version, written in Visual Basic 3 (so now you can click with a mouse!!)  So I thought, it's time for a revival - let's make an online version.  So here it is:

http://mathsanswers.org.uk/games/squares/
Very nice game.  I was not familiar with it before. 

Olemis Lang

unread,
Jan 27, 2016, 10:31:43 PM1/27/16
to bry...@googlegroups.com
[...]

Immediately after reading this I had a idea . In the next few months
I've scheduled more than one talk about Brython , and I'm hoping that
some of them will be addressed to children under 12 yo.

So ideally what I'm thinking of is as follows :

- To put these games altogether
(Brython Github organization would be the
first target I'd suggest to do so) somehow
* e.g. in a single repository brython/brython-games
* e.g. each game in its own repository under brython org
plus another (meta)repository including the former as
sub-modules [1]_ and adding an index page with
the following features :
+ icon & short name for each game
+ on click start playing selected game
+ games grouped by category
o Puzzle games
o 3D games
o Card games
o Board games
o ...
+ search by matching query string against game name

Ideally they will be published at a given domain ( brython.info ?
games.brython.info ? other ? ) .

In case of being offline , I'd find it very useful to be able to
deploy a WiFi hotspot at the venue(s) and setup a server with a
handful of such games out there powered by Brython , so that the
audience might be able to try some during the time dedicated to the
talks .

Does it sound like a good idea ?

.. [1] https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects

--
Regards,

Olemis - @olemislc

Apache™ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Brython committer
http://brython.info
http://github.com/brython-dev/brython

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Christophe Bal

unread,
Jan 28, 2016, 2:47:50 AM1/28/16
to bry...@googlegroups.com

Hello.

I think that more generaly an organization on Github for Brython example should be very useful

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CAGMZAuPqPQKMwsFnh7A0qGYmDino6hF%3D4sGhPXBLXKrr9dDZKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Andy Lewis

unread,
Jan 28, 2016, 2:55:57 AM1/28/16
to brython


On Thursday, January 28, 2016 at 1:01:08 AM UTC, André wrote:

Very nice game.  I was not familiar with it before. 

Well, I have never publicised it before, so probably the only people who do know it are the pupils I have taught over the last 30 years.
Andy
 

Kiko

unread,
Jan 28, 2016, 3:39:16 AM1/28/16
to bry...@googlegroups.com
Hahahaha, Marvin (the computer) won me few times... Now I understand better the game I'm improving
:-P

 Quite addictive!!!
 
Thanks.

@olemis
Here you have two simple games. The puzzle should be loaded two times to make it work ¿?:
https://github.com/kikocorreoso/Brython-PyConES-2013

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.

Andy Lewis

unread,
Jan 28, 2016, 4:15:37 AM1/28/16
to brython

Well, since the success of Raspberry Pi, it seems that Python is the language of choice for teaching children programming. So it would seem logical that they should move on to Brython for web programming. So I think it's great that you are starting to do this.

Do the games need to be brought together?  Would a page linking to each game, like
https://github.com/brython-dev/brython/wiki/Brython%20in%20the%20wild
be quicker to create, and serve the same purpose?  It could be made prettier, with icons instead of text links, like you say.

I suppose the advantage of a repository would be if you needed to clone it offline in case there was no internet available where you were giving your talk.  You will know best what your requirements are likely to be.

All the best for the talks,

Andy

PS I have one other Brython game if it is any use to you (it is really a puzzle, a one-player game):
http://mathsanswers.org.uk/games/flipit/
I didn't invent this one (it is in Simon Tatham's games pack, for example: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ (called "Flip") ).
But I added some things to help analyse the puzzle (like recording the moves made).


Message has been deleted

Olemis Lang

unread,
Jan 28, 2016, 6:06:45 PM1/28/16
to bry...@googlegroups.com
On 1/28/16, Kiko <kikoco...@gmail.com> wrote:
>
[...]
>
> @olemis
> Here you have two simple games. The puzzle should be loaded two times to
> make it work ¿?:
> https://github.com/kikocorreoso/Brython-PyConES-2013
>

Thanks , do you think it's a good idea to ad them in brython github
org ? If so , could you do so (I'm assuming you have been granted with
permission in advance, since u r a committer) ?

[...]

Olemis Lang

unread,
Jan 28, 2016, 7:11:09 PM1/28/16
to bry...@googlegroups.com
On 1/28/16, Andy Lewis <andy3...@gmail.com> wrote:
> On Thursday, January 28, 2016 at 3:31:43 AM UTC, Olemis Lang wrote:
>>
[...]
>>
>> In case of being offline , I'd find it very useful to be able to
>> deploy a WiFi hotspot at the venue(s) and setup a server with a
>> handful of such games out there powered by Brython , so that the
>> audience might be able to try some during the time dedicated to the
>> talks .
>>
>> Does it sound like a good idea ?
>>
>>
>
[...]
>
> Do the games need to be brought together? Would a page linking to each
> game, like
> https://github.com/brython-dev/brython/wiki/Brython%20in%20the%20wild
> be quicker to create, and serve the same purpose? It could be made
> prettier, with icons instead of text links, like you say.
>

I was thinking of something along the lines of PLT Games windows [1]_
easily deployable onto a server .

> I suppose the advantage of a repository would be if you needed to clone it
> offline in case there was no internet available where you were giving your
> talk. You will know best what your requirements are likely to be.
>

Also auto-deployment . I mean, deploy a new version onto a server by
configuring web hooks reacting upon merging code into a given branch
(e.g. master) ... and maybe more useful things might be done this way
.

> All the best for the talks,
>

Thanks !
:)

> Andy
>
> PS I have one other Brython game if it is any use to you (it is really a
> puzzle, a one-player game):
> http://mathsanswers.org.uk/games/flipit/
> I didn't invent this one (it is in Simon Tatham's games pack, for example:
> http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ (called "Flip") ).
> But I added some things to help analyse the puzzle (like recording the
> moves made).
>

Good ! \o/

.. [1] http://img.ctrlv.in/img/16/01/28/56aaaa8ae7e15.png

Kiko

unread,
Jan 29, 2016, 3:06:48 AM1/29/16
to bry...@googlegroups.com
A repo on the Brython-dev organisation called brython-games would be fine?
If you don't need to import libs (e.g., using brython-dict.js) we could create a gh-pages for the games.
https://github.com/brython-dev

Christophe Bal

unread,
Jan 29, 2016, 3:17:30 AM1/29/16
to bry...@googlegroups.com

+1 for the game folder.

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.

Olemis Lang

unread,
Jan 29, 2016, 9:00:45 AM1/29/16
to bry...@googlegroups.com
I do not know what others think , but I'd be ok with it . Let's say
that in there we could work on games index page + a set of games
contributed by brython-dev committers , like the ones you mentioned
before . Besides other games, like Andy's , may be integrated as
sub-modules .

> If you don't need to import libs (e.g., using brython-dict.js) we could
> create a gh-pages for the games.
> https://github.com/brython-dev
>

I am not aware of specific game deps ... index page should not have many .

[...]

Olemis Lang

unread,
Jan 29, 2016, 10:34:15 AM1/29/16
to bry...@googlegroups.com
On 1/28/16, Andy Lewis <andy3...@gmail.com> wrote:
> On Thursday, January 28, 2016 at 3:31:43 AM UTC, Olemis Lang wrote:
>
[...]
>
> I suppose the advantage of a repository would be if you needed to clone it
> offline in case there was no internet available where you were giving your
> talk. You will know best what your requirements are likely to be.
>

<OT> recently I've learned that preparing for *offline-ness* is a best
practice [1]_ </OT>

.. [1] https://github.com/nodeschool/organizers/wiki/Venue-Best-Practices

Andy Lewis

unread,
Jan 29, 2016, 11:19:36 AM1/29/16
to brython
On Friday, January 29, 2016 at 3:34:15 PM UTC, Olemis Lang wrote:
<OT> recently I've learned that preparing for *offline-ness* is a best practice [1]_ </OT>

Yes if I want to show anything (video, presentation) I always download it even if I think there will be a reliable connection.

Go for it with the repository.  I will help if I can, but I didn't understand some of what you were talking about (auto-deployment web hooks?)...

Andy

PS Squares didn't work on an iPhone, I was showing it to a friend today. :-(
I will look into why - need to find out if it works with other Apple devices.


Pierre Quentel

unread,
Jan 29, 2016, 1:35:54 PM1/29/16
to brython
Congratulations for the games ! I like flipit as much as squares, if not more.

I'm all for a games repository. Simple and addictive games like these, especially if they can be adapted for smartphones and tablets, are a very good example of what can be done client side with Brython.
Reply all
Reply to author
Forward
0 new messages