
This can be ordered like that:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bar.receive_order(client.put_words_in_mouth('Un croissant, por favor.').speak_up) |

This can be expressed as:

and be calculated with use of:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- lib(ic). | |
croissant(X,Y,Z) :- | |
(X^2+Y^2+Z^2+7*sqrt(5)/2-11/2)^2 - ((1+sqrt(5))*X-7+3*sqrt(5))^2-(1+sqrt(5))^2*Y^2 $= 0, | |
locate([X,Y,Z], 1e-5). | |
# one of the solutions | |
croissant(X,Y,Z). | |
X = X{0.0 .. 7.4073630564431975e-6} | |
Y = Y{1.066573563196598 .. 1.0665754743970506} | |
Z = Z{7.4073630564431975e-6 .. 1.4814726112886395e-5} |
I wouldn't recommend to find solutions for this equation in Ruby, so the example is in ECLiPSe CLP. It is a great tool (environment) for solving contraint logic problems. It's also fun. For me.
I saw this equation in Barselona museam! Funny!
ReplyDelete