A cryptarithmetic puzzle is an equation with words whose letters represent decimals digits.
Questions tagged [cryptarithmetic-puzzle]
63 questions
0
votes
0 answers
AM + PM = DAY CryptoArithmetic Puzzle Prolog
I need the output to be in the format below. I have the exact output except the last line, and I cannot figure out how to add the last line to the output. I would appreciate any help.
Output
A = 2,
M = 5,
P = 9,
D = 1,
Y = 0,
…

Rob
- 1
- 3
0
votes
2 answers
Prolog: how to optimize this code(Solving 123456789=100 puzzle)
So there was a puzzle:
This equation is incomplete: 1 2 3 4 5 6 7 8 9 = 100. One way to make
it accurate is by adding seven plus and minus signs, like so: 1 + 2 +
3 – 4 + 5 + 6 + 78 + 9 = 100.
How can you do it using only 3 plus or minus…

Yegor
- 1
- 1
0
votes
1 answer
I'm stuck on this verbal arithmetic algorithm
Given the format string (11 characters, without space) in the form of ABC+DEF=GHI, where A, B, C, D, E,
F, G, H, I are representing decimal digit (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) "placeholders" (not necessarily distinct!),
develop and implement an…

CrazyGuy
- 17
- 1
0
votes
1 answer
Cryptarithmetic puzzle
I am trying to solve this cryptarithmetic puzzle TWO + TWO = FOUR and I used a raw brute force, but I can't figure out where I am making mistake. The idea here is that it tries all possible combinations of numbers from 0 to 10 and all numbers that…

mrGreenBrown
- 576
- 1
- 7
- 20
0
votes
2 answers
Cryptarithmetic puzzle generic solution in Python 3
I am stuck with this problem statement, My code does work but I used itertools.permutations and that makes it very slow. Moreover, I don't know how to make it generic for all or any input. I think I have to use backtracking but I am not use how to…

Pooshan Vyas
- 23
- 1
- 2
- 8
0
votes
1 answer
How can I prevent this Prolog code to give multiple duplicate answer?
I am learning Prolog. I am working on an assignment. I have already produced some code, which is partially working. But, somehow it is giving multiple duplicate answers.
The question is:
% Every letter represents a Digit (0,...,9).
% Leading digits…

Srijani Ghosh
- 3,935
- 7
- 37
- 68
0
votes
1 answer
Cryptarithmetic multiplication returning false
I would think my prolog code would work for this multiplication problem but it's returning false. Am I missing something?
solve(T,W,O,S,I,X,E,L,V) :-
X = [T,W,O,S,I,X,E,L,V],
Digits = [0,1,2,3,4,5,6,7,8,9],
assign_digits(X,…

user2318083
- 567
- 1
- 8
- 27
0
votes
1 answer
How to solve a Cryptarithmetic puzzle?
I'm studying Artificial Intelligence. So far I've read few chapters of the reference book: Artificial Intelligence, 2nd Edition, by Elaine Rich and Kevin Knight.
I'm stuck at this problem called as 'Cryptarithmetic Problem'. Can anyone provide me a…

overlord
- 1,059
- 1
- 14
- 21
0
votes
2 answers
Java program to solve simple cryptarithmetic puzzle
Edit: I got my program working now, but still need some clarification for the else if (400*T + 40*O + 4*O == 1000*G + 100*O + 10*O + D) part that is key to solving the puzzle. I just want to fully understand every bit of the program, thank you.
This…

novice9
- 5
- 1
- 2
- 5
0
votes
1 answer
what does C1 mean in cryptarithmetic puzzle in polog?
Here is a snippet of cryptarithmetic in prolog
sum1( [D1|N1], [D2|N2], [D|N], C1, C, Digs1, Digs) :-
sum1( N1, N2, N, C1, C2, Digs1, Digs2),
digitsum( D1, D2, C2, D, C, Digs2, Digs).
As below explains
sum1( N1, N2, N, C1, C, Digits1,…

stonestrong
- 337
- 1
- 5
- 13
0
votes
3 answers
how to find cryptarithmetic letter value?
Cross + roads = danger ==> the answer is ==> 96233 + 62513=158746
I'm looking for a instruction to find the answer easier for another example. one of my teacher said that we can using tree to find it. but sometimes using tree to find the answer is…

Azad Com
- 45
- 1
- 6
0
votes
2 answers
assigning numbers to letters
I'm trying to solve a problem of cryptography (assigning numbers to letters)
GERALD + DONALD = ROBERT
Each letter represents a different number (between 0 and 9).
The first letter of each word represents a digit different from 0.
The problem :
the…

Dev M
- 1,519
- 3
- 29
- 50
-1
votes
1 answer
Is there a possible implementation for this problem?
Having a bit of trouble doing research and trying to solve this problem in PROLOG. I have to implement a cryptarithmetic-puzzle solver able to solve any possible cryptarithmetic-puzzle. I'll explain in a bit more detail below.
Given as input a list…

Hachiko1337
- 23
- 4
-1
votes
1 answer
Cryptarithmetic puzzle Prolog
I have the following task in Prolog:
Find an assignment of the letters to digits (each letter to a different digit) so that the following product holds:
EAU * EAU = OCEAN
If the code for this is as follows:
:- use_module(library(clpfd)).
ocean(L)…

CompilerSaysNo
- 415
- 3
- 14
-1
votes
1 answer
How to use the labeling function of Prolog (ECLIPSE program) within the SEND+MORE = MONEY program?
So I managed to write the SEND + MORE = MONEY program for Prolog and I'm having trouble labeling the results. Any ideas on how to do that? I keep using the labeling function but it still wouldn't work. I'm lost here.
:- lib(ic).
puzzle(List) :-
…

user3390252
- 49
- 4