Questions tagged [cryptarithmetic-puzzle]

A cryptarithmetic puzzle is an equation with words whose letters represent decimals digits.

63 questions
1
vote
1 answer

Instantiation fault ECLiPSe CSP

I have problems with my CSP under ECLiPSe. I wish to add a constraint to my cryptogram which requires that the number represented by TWO is divisible by 2. [eclipse 11]: test(Xs). instantiation fault in (_268{[1..4]}*100 + _200{[0..9]}*10 +…
1
vote
2 answers

No output in prolog

I am new to Prolog and was using it to solve a cryptarithmetic problem CROSS+ROADS = DANGER .However when the code is run ,there is no output can anybody tell me what is wrong with the program? I will be very thankful. Code: :-…
Pooja Gupta
  • 357
  • 1
  • 4
  • 13
1
vote
1 answer

Prolog Cryptarithmetic program

I'm taking a programming course and the professor just lightly skimmed over Prolog due to lack of time. Anyways, he suggested we research it on our own. I came across a Cryptarithmetic program that is supposed to calculate? AM+PM = DAY. I do not…
NoobCoderChick
  • 617
  • 3
  • 21
  • 40
1
vote
0 answers

Re-assigning variables for cryptarithmetic puzzle in Prolog

I'm using Prolog to solve generic cryptarithmetic puzzles for a homework assignment. I'll talk about this in the context of SEND + MORE = MONEY. The partial code that my professor gave me reduces the 3 input lists, i.e. [S,E,N,D], [M,O,R,E],…
Cat Snacks
  • 96
  • 4
1
vote
1 answer

Generic prolog cryptarithmetic program

I'm trying to write a program to solve general cryptarithmetic puzzles such as AM+PM=DAY, SEND+MORE=MONEY.. The program I've written is: gsolve([H1,T1],[H2|T2],[H3|T3]):- …
usb
  • 279
  • 1
  • 5
  • 15
1
vote
1 answer

Need assistance with similar More Money code for Prolog

Every letter below in the puzzle uniquely represent one of the 10 digits in 0, 1, …, 9. No two letters represent the same digit. For each word below in the puzzle, the first letter is not 0. Ex: SHINE - THAN == KNIT All I've got for the code is…
1
vote
1 answer

cryptarithmetic prolog test fails recursion idea

I need to test this code for crypt arithmetic for two + two = four but it is giving me false which is wrong. I need to know why is this happening. It works for donald+robert= gerald or it+is=me. I got the idea of how recursion works but since i…
user3342812
  • 343
  • 8
  • 25
1
vote
3 answers

Finding a brute force algorithm for the following cryptarithm / alphametic puzzle

I'm trying to write a program in C that will solve the following cryptarithm: one + one = two seven is prime nine is a perfect square Namely, I need to find the numerical values for the words one, two, seven and nine where each letter (o, n, e, t,…
Martin
  • 1,060
  • 2
  • 16
  • 28
0
votes
2 answers

how to solve when the number of variables in the goal/query varies - Prolog Constrain Solver

Here's a snippet on the classic SENDMORY crypt-arithmetic problem solutiong using prolog constraint solving mechanism- :- lib(ic). sendmore(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], alldifferent(Digits), S #\= 0, M #\= 0, 1000*S +…
kallakafar
  • 725
  • 3
  • 11
  • 27
0
votes
2 answers

Solving this cryptarithmetic program gives infinite results

I am doing the EAT+ THAT= APPLE, where each letter represents a different number from 0-9. I need to find all combinations. I was wondering if there is a better way to write it, especially 'if' and 'for' I've tried writing it like this but it gave…
user19705717
0
votes
0 answers

Solve Cryptarithmetic Problem with Forward Checking

I want to solve Cryptarithmetic Problem with Forward Checking. CP + IS + FUN = TRUE BALL + GUN + NO = HUNT I can solve it with brute-force, but don't know how to use Forward Checking. Please help me
0
votes
1 answer

is it possible to find the n'th number in this sequence using code which does not require bruteforce?

I have been asked this question where I am asked to find the Nth number in the sequence. The sequence goes like this 555 35 1315 11131115 31133115 1321232115. The sequence is a count of each character in the string. Let's say I start with 555, then…
Sai Kumar
  • 201
  • 2
  • 8
0
votes
3 answers

Unexpected results for 'finding the digits' problem using recursion in Common Lisp

The "finding the digits problem" is this: Find unique decimal digits A, B, C such that CCC + BBB + AAA = CAAB To solve it using recursion in Common Lisp, I've written this code: (defun find! () (found? 0 ;; initially point…
0
votes
0 answers

Crypt-arithmetic puzzle help: SANTA-CLAUS=XMAS

I'm trying to solve the crypt-arithmetic puzzle: SANTA-CLAUS=XMAS in ECLIPSE Prolog. I am using the puzzle "SEND+MORE=MONEY" as a guide to do so. My problem that I'm not sure how to implement the "borrowing" part of subtraction. In addition, there's…
sweets
  • 9
  • 1
0
votes
3 answers

Is there a different way to write multiple conditions in Python?

I'm new to python, I am doing the TWO + TWO = FOUR, where each letter represents a different number from 1-10. I need to find all combinations. I was wondering if there is a better way to write it, especially 'if' and 'for' for t in range (1,10): …
Hau Le
  • 3
  • 2