I want to use Choco solver to write a Java program that generates math problems that satisfy a number of constraints. The problems have to take the following form:
x @ y ∆ z = r
Where:
x
,y
&z
are positive integers, not necessarily different from one another, with one of them being 2 digits long and the other two 1 digit long@
&∆
are operators +, - or * (note that both can also stand for the same operator)
r
is a positive 1-digit integer
I want to generate these math problems "on demand" (as in, one at the time) and they need to be randomised (i.e. there no should be no pattern or fixed order across the generated problems).
It has been well over 10 years since I have done constraint (satisfaction) programming, but I believe C(S)P (preferably by means of Choco), is a suitable tool to apply here. Is this correct and can someone help me get started?