Hot answers tagged

37 votes
Accepted

The Game of Hex in Mathematica

The flow in my program is: I have one global variable, board, which is an 11x11 matrix. Each matrix element corresponds to a hexagon on the board. I pass the board ...
C. E.'s user avatar
  • 70.4k
32 votes
Accepted

Can Mathematica put these puzzle pieces together?

Assuming polygons follow the same (clockwise or counterclockwise) vertex order, find all good quality two line segment rigid mappings between polygons without overlap with each other (at least much ...
kirma's user avatar
  • 19k
25 votes
Accepted

Programming the fiver game

In this case I don't know how to post something helpful without providing full code so I'll just do that and hope this wasn't homework. My emphasis is on clarity (hopefully) rather than brevity or ...
Mr.Wizard's user avatar
  • 271k
22 votes

Can Mathematica put these puzzle pieces together?

For a different approach with image processing, I start with the image of your puzzle. ...
Sumit's user avatar
  • 15.9k
21 votes
Accepted

Minesweeper: How to Dynamic a lot of graphics with high-speed?

The issue with such multicontroller dynamic interfaces is that one usually wants to store the state of all controllers in one variable for convenience (e.g. store status of position ...
István Zachar's user avatar
20 votes

The Game of Hex in Mathematica

Here is an answer that provides modular definitions that allow plotting the play-table and players moves with different options, and testing for a complete path by a player. (The function ...
Anton Antonov's user avatar
13 votes

The Game of Hex in Mathematica

Mostly working, just don't click the intersections. I seemed to have reversed the colours, but that's easily fixed, just set re and ...
Feyre's user avatar
  • 8,577
13 votes

Sophisticated API integrations / Making a card game in Mathematica

This will be an answer in two parts. The first is how to build out a sophisticated, stateful ServiceConnection. The second is how to use this to build out an ...
b3m2a1's user avatar
  • 46.8k
11 votes
Accepted

Hanoi Tower minimum moves between any two states

We start with a better abc encoding (the one shown on your graph picture). State aabcac means: on first rod (rod a), there are ...
Vasily Mitch's user avatar
11 votes
Accepted

The Battleship game: Identify objects within a matrix

NearestNeigborGraph + ConnectedComponents ...
kglr's user avatar
  • 392k
9 votes

Programming the fiver game

Here is a version that uses only the Front End, which can be verified using LinkSnooper. This is mostly a useless optimisation/exploration. ...
Jacob Akkerboom's user avatar
8 votes
Accepted

How to generate optimal solution and order the rest

First, let's define the edges of this graph: ...
eyorble's user avatar
  • 9,373
8 votes
Accepted

How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Based on eyorble's comment here's how to do it with generating functions. The main idea: with some probability distribution $p_n: P(X=n)=p_n$ you can associate a polynomial called the generating ...
AccidentalTaylorExpansion's user avatar
8 votes

The Battleship game: Identify objects within a matrix

SparseArray + FindClusters ...
kglr's user avatar
  • 392k
7 votes

How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Implementing @eyorble's idea in the comments: problist[n_, d_] := Rest[CoefficientList[(1/d Sum[x^i, {i, 1, d}])^n, x]] This returns a list of length $nd$ ...
Michael Seifert's user avatar
7 votes

The Battleship game: Identify objects within a matrix

One attempt: ...
vindobona's user avatar
  • 2,401
7 votes

The Battleship game: Identify objects within a matrix

Here is a step-by-step procedure: ...
lericr's user avatar
  • 26.4k
6 votes

The Game of Hex in Mathematica

Dead end When I first saw this question I immediately thought of a Voronoi diagram because it is so easy to do this: ...
Mr.Wizard's user avatar
  • 271k
6 votes

TuGames package does not run

In order to avoid in the future any annoying error message that has been mentioned above while following a manual installation that does not respect best practice of publicizing a Mathematica package, ...
Holger I. Meinhardt's user avatar
5 votes

How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Define two helper functions. One for the generator function of NdS expressed as a polynomial in terms of $x$: dg[x_, n_, s_] := (x (x^s - 1)/(x - 1))^n; And ...
eyorble's user avatar
  • 9,373
5 votes

Chess in Mathematica

Wolfram Language 13.2 has a built-in preliminary support for chess. You can import PGN files and FEN strings, render positions as graphics, process game metadata, display dynamic game summary and more....
rafalc's user avatar
  • 1,349
5 votes

webmathematica to share my game?

This applies to any Wolfram Cloud based web application, not simply to your question, but there are say 4 steps involved in creating a web app. Hopefully some of this carries over from WC to ...
b3m2a1's user avatar
  • 46.8k
5 votes

Convert image of graph to Graph

On my system, MorphologicalGraph with the default Method can't seem to find all the vertices of the graph. I ended up with the ...
Carl Woll's user avatar
  • 130k
4 votes
Accepted

Can Mathematica help me win my on-line game?

Running the code below, which shows the results for runs of 1000 shots, the rewards as set mean you should always take the 100% shot. With different rewards you could add a condition to take a ...
Chris Degnen's user avatar
  • 30.8k
4 votes

The Battleship game: Identify objects within a matrix

This should, at least and at last, convince me to start learning about graphs. ...
Syed's user avatar
  • 48.4k
4 votes

The Battleship game: Identify objects within a matrix

MapIndexed + SplitBy ...
kglr's user avatar
  • 392k
3 votes

Can Mathematica help me win my on-line game?

I know I'm a billion years late on this, and an answer now won't do anyone any good, but I found it really interesting for some reason. I'm not great with probabilities, but my reasoning seemed to ...
MassDefect's user avatar
  • 10.1k
2 votes

24 Math Game Algorithm?

try all possible combinations (4*3*2*1*4^3=1536) ...
Harry's user avatar
  • 2,715
2 votes

Input without dialog

...
David G. Stork's user avatar
2 votes
Accepted

Plot of TU game on Windows

To compute the barycenter of the extreme points of the core, I recommend to apply my Mathematica Package TuGames that can be downloaded from the following URL Mma Package TuGames To install the ...
Holger I. Meinhardt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible