### Random Post

### Recent Posts

### Recent Comments

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… | |

Jim Randell on Enigma 1627: A riddle for the… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,903 hits

Advertisements

See also:

Puzzle 78andEnigma 239.Here I’ve used a simple MiniZinc model to solve this problem. The [[

mzn-g12fd]] solver executes it in 110ms.Solution:The scores in the played matches are: AvB = 2-2; AvE = 4-5; BvE = 1-3; CvD = 2-1; DvE = 4-5. The remaining matches are not yet played.Here’s another MiniZinc model, using a matrix for the scores (which seemed more natural for me).

@hakank: Thanks for your post. Sorry you had problems (at one time I hoped that WordPress.com would allow the ability to edit (or even preview) comments, but it never happened).

I took the code from the link you posted and incorporated it into the original comment, using:

[code language="text"]...[/code]tags to preserve the code. (See [ https://en.support.wordpress.com/code/posting-source-code/ ] for a list of supported languages). I deleted the followup comments where you were trying to sort it out. Hope that’s OK.

@jim Thanks for this. And sorry for messing things up. I’ll try to remember that it should be “code” and not “pre” that I should use. And I’ll test it right away with a new comment on the Picat code. 🙂

And here’s the same approach in Picat: http://hakank.org/picat/football_five_teams_new_method.pi

Solved in about 15millis.

Here’s the Picat code mentioned above:

@hakank: Thanks for the pointer to Picat. It looks interesting. I’ve downloaded it and I’ll have a closer look at it later.

@jim: Yes, Picat is an interesting language. I’m kind of involved with Picat and co-authored the book “Constraint Solving and Planning with Picat” together with Neng-Fa Zhou (creator of Picat) and Jonathan Frumann in 2015. The book is now free to download: PDF via http://picat-lang.org/picatbook2015.html (I was the main author of the two Constraint Programming chapters). Here’s my Picat page with some programs in different areas of interest: http://hakank.org/picat/ .

MiniZinc has better support for some type of constraints (e.g. element: z = x[y] where x, y, and z are all decision variables) and also has support for many different FlatZinc solvers, among them Picat. Picat, on the other hand, is a complete programming language where one can write traditional “imperative” loops (which MiniZinc don’t allow). So MiniZinc and Picat are both favourite languages, and nowadays I tend to implement models in both languages.