mscroggs.co.uk
mscroggs.co.uk

subscribe

Blog

 2015-08-27 

MENACE

Showing all comments about the post MENACE. To return to the blog post, click here.

Comments

Comments in green were written by me. Comments in blue were not written by me.
@JT: I bought "craft matchboxes" (without the matches inside), but it looks like your bulk normals ones work out cheapers.
Matthew
                 Reply
@JT: correction, the best deal I have found is $120.48
https://www.amazon.com/dp/B07F6PY9XF/r...
JT
                 Reply
@Matthew: where do you buy your matchboxes at? Because I need 1296 and the best deal I have found is 1300 for $147.57 two packs of 500 for $49.65 each and three packs of 100 for $16.09 each.
JT
                 Reply
@Matthew: would it still work with the "roll over" rule? or would that just make it run out?
JT
                 Reply
@Matthew: Thank you so much, could you email me a link for it once you make it.
JT
                 Reply
@JT: Yes, you could. You need a matchbox for each possible combination of fingers on the players' hands, an beads in each box for each move that could be made in that position.

When I have some time, I'll have a go a write a javascript version of it...
Matthew
                 Reply
Hello Matthew Scroggs, I was wondering if it would be possible to make a "menace" with the game chopsticks? If you don't know what chopsticks is, then here are the rules listed on Wikipedia
Each player uses both hands to play the game, the number of fingers extended on a hand shows the number of points that the hand has.

Both players start with each hand having one point — one finger extended on each hand.

The goal of the game is for a player to force their opponent to extend all of their fingers and thumbs on both hands or to force the player to extend all their fingers and thumb and one hand if their other hand is already out. The score has to be exactly five. If the resulting number is more than five, the player is not out no matter what. For example, if a hand with 4 points is tapped by a hand with 2 points, the hand with 4 points becomes a hand with 1 point. This rule is called a 'roll over'.

Players take turns to tap their live hand(s) against another live hand (either their own other hand or one of their opponent's).

You can tap any live hand per turn, but only one

The number of points on the tapping hand is added to the number on the tapped hand, and the player with the tapped hand extends their digits to show the new score. The tapping hand remains unchanged.

A player may tap their two hands together to transfer points from one hand to the other. This is called a split. If a player has one hand out (0 fingers) and two fingers, on the other hand, they could split to have one finger on each hand. (This counts as a turn).You are not allowed to "swap hands" or switch the number of fingers between hands without splitting (going from 4 on one hand and 2 on the other to 2 on one hand and 4 on the other).
JT
                 Reply
Can you make a version where the ai goes second?
Nukey
                 Reply
@Sterling: To make a MENACE to play chess, you'd need to draw every possible position in chess. As I wrote in this blog post, if you had a matchbox for each possible chess position, your pile of matchboxes would be this big:



This number of positions is too big for this method of learning to work for chess, so you'd need a more advanced method...
Matthew
                 Reply
After watching the video with yourself and Matt, you commented on teaching it chess are there any PDFs on how to teach, the machine chess. Ie what are the mechanics
Sterling
                 Reply
@Alex: You can find the pdfs here. boxes0.pdf to boxes3.pdf are the states for a MENACE that goes first. second_boxes0.pdf to second_boxes2.pdf are the states for a MENACE that goes second.
Matthew
                 Reply
I know this has been asked a lot but would it be possible if you could make a pdf of all possible states of the game on your website? If not please just send them to me directly. Thank you, alex
Alex
                 Reply
@Alexis: Well spotted. There was a typo in the variable name used for the third move boxes, I've fixed this now
Matthew
                 Reply
When I try to change the settings of MENACE2, the sixth move is considered "NaN"... Hope you can fix this
Alexis
                 Reply
@David: I'll email you some pdfs. I've also added the (ugly) Python code I used to make the LaTeX that makes the pdfs to GitHub.
Matthew
                 Reply
My son is looking at doing a variation of this for his science fair, 2 questions: 1) Has there been a version where MENACE moves 2nd? 2) where might I find a pdf of the game states, at least for MENACE moving 1rst, but if possible moving 2nd
David
                 Reply
@Sam: I've emailed them to you
Matthew
                 Reply
I loved the standupmatha video on your MENACE, and I’m trying to build my own. Any way I could get a pdf with the 304 game states on it? Thanks! :)
Sam
                 Reply
@Marc St-jacques: To build MENACE, I only used the boards that could happen when it is player 1's turn, as MENACE always plays as player 1.
Matthew
                 Reply
Hi. I tried to implement my own version but I'm stuck at generating 626 boards, after removing impossible boards, wins and ties and transposing all 8 positions for each remaining board. This fellow here https://stackoverflow.com/a/32019787/7... comes to a similar conclusion stating there are 626 mid-game boards. So what am I missing to reduce my number to 304 ? --- PS. I could have asked the fellow in question, but my reputation on S-O is too low. :(
Marc St-jacques
                 Reply
I put it into a resign loop after 3 games. Left it resigning for a few hours, after selecting 'random' and speed to maximum, just to see what happens. 15 seconds for the first 1,000 resigns. After a couple of hundred thousand resigns, it had slowed to about 10% of the initial speed. It didn't crash. You could use an unlimited number of beads in the first move box, to stop people like me from finding the boundaries!
g0mrb
                 Reply
It seems to work! It didn't loop! Is there a way to represent the matchboxes (the game positions) in memory so that the 90 and 180 rotations of a same position would automatically be the same matchbox object ?
Misccold
                 Reply
I played ~40 games and then it got stuck in a loop of "MENACE resigns" on an empty board. I didn't touch the settings. Cool project :-)
Misccold
                 Reply
@Blan: I think I've fixed that. Let me know if you still have the same problem after refreshing the page.
Matthew
                 Reply
The online version of MENACE is really glitchy. Whenever you change the settings, it just keeps going in the corner. For instance, I changed it to get 1 bead per victory, and it just kept going in the corner every time. It made its second move, and then it just stopped playing after that. I put x's all over the board until I won. This happens with a lot of the custom settings.
Blan
                 Reply
@Matthew: Cool, thanks! Also thanks for translating the site to German, really useful.
Stephan Graf
                 Reply
@Stephan Graf: I do. I will email them to you
Matthew
                 Reply
I would like to build my own menace. Would you happen to still have a document template with the possible game states in matchbox size? This could save me some work ;)
Stephan Graf
                 Reply
If you take one bead out on a loss and put three in on a win, then a careful human player (by judicious choice of moves) can win almost three times as much as losing, without letting the machine "catch on"
Martin
                 Reply
@Steve Paget: I've also made a physical MENACE since writing this. I plan to make a video at some point: I'll let you know when I do...
Matthew
                 Reply
Oh, I just read further and saw that Oliver made the physical MENACE. I shall menace him instead!
Steve Paget
                 Reply
I would love to see a game being played with this machine. Could you make a Youtube video of a game in progress, so we can see it in action? How long does a typical game last with a trained engine?
Steve Paget
                 Reply
@Joe: There may be a mistake in the source code somewhere. I will look into it.
Matthew
                 Reply
Whenever the board turns into two opposite corners, and I have played in bottom middle and center, Menace stops playing for some reason (aka I get a free move).
Joe
                 Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li>
To prove you are not a spam bot, please type "sixa-y" backwards in the box below (case sensitive):

Archive

Show me a random blog post
 2020 

Feb 2020

PhD thesis, chapter ∞
PhD thesis, chapter 5
PhD thesis, chapter 4
PhD thesis, chapter 3
Inverting a matrix
PhD thesis, chapter 2

Jan 2020

PhD thesis, chapter 1
Gaussian elimination
Matrix multiplication
Christmas (2019) is over
 2019 
▼ show ▼
 2018 
▼ show ▼
 2017 
▼ show ▼
 2016 
▼ show ▼
 2015 
▼ show ▼
 2014 
▼ show ▼
 2013 
▼ show ▼
 2012 
▼ show ▼

Tags

computational complexity nine men's morris noughts and crosses chebyshev light talking maths in public determinants inverse matrices arithmetic braiding captain scarlet royal baby wool golden ratio simultaneous equations pizza cutting accuracy folding paper world cup fractals mathsjam weak imposition video games geometry cross stitch royal institution sorting pac-man interpolation european cup bodmas polynomials chess football probability approximation hexapawn propositional calculus weather station chalkdust magazine manchester pythagoras ternary books electromagnetic field final fantasy dragon curves mathsteroids go bubble bobble tmip reuleaux polygons game show probability asteroids tennis christmas card oeis harriss spiral rhombicuboctahedron curvature python php wave scattering hannah fry news bempp gerry anderson matt parker menace manchester science festival radio 4 trigonometry people maths map projections folding tube maps data visualisation mathslogicbot misleading statistics flexagons programming realhats gaussian elimination data raspberry pi london dataset inline code national lottery christmas sound dates binary draughts the aperiodical estimation triangles speed rugby javascript frobel palindromes matrix of minors signorini conditions error bars twitter london underground advent calendar graph theory preconditioning phd countdown martin gardner plastic ratio finite element method hats puzzles golden spiral sobolev spaces latex reddit boundary element methods matrix of cofactors matrices games platonic solids logic coins a gamut of games cambridge stickers big internet math-off matrix multiplication numerical analysis game of life craft ucl statistics machine learning sport

Archive

Show me a random blog post
▼ show ▼
© Matthew Scroggs 2012–2020