I have this problem to solve that is shown in the picture. i have tried the code given below
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from constraint import *
problem = Problem()
problem.addVariable('oneACROSS',['HOSES','LASER','SAILS','SHEET','STEER'])
problem.addVariable('fourACROSS',['HEEL','HIKE','KEEL','KNOT','LINE'])
problem.addVariable('sevenACROSS',['AFT','ALE','EEL','LEE','TIE'])
problem.addVariable('eightACROSS',['HOSES','LASER','SAILS','SHEET','STEER'])
problem.addVariable('twoDOWN', ['HOSES','LASER','SAILS','SHEET','STEER'])
problem.addVariable('threeDOWN', ['HOSES','LASER','SAILS','SHEET','STEER'])
problem.addVariable('fiveDOWN',['HEEL','HIKE','KEEL','KNOT','LINE'])
problem.addVariable('sixDOWN',['AFT','ALE','EEL','LEE','TIE'])
problem.addConstraint(lambda oneACROSS,twoDOWN : oneACROSS[3]==twoDOWN[1])
problem.addConstraint(lambda oneACROSS,threeDOWN : oneACROSS[5]==threeDOWN[1])
problem.addConstraint(lambda fourACROSS,twoDOWN : fourACROSS[2]==twoDOWN[3])
problem.addConstraint(lambda fourACROSS,fiveDOWN : fourACROSS[3]==fiveDOWN[1])
problem.addConstraint(lambda threeDOWN,fourACROSS : fourACROSS[4]==threeDOWN[3])
problem.addConstraint(lambda twoDOWN,sevenACROSS : sevenACROSS[1]==twoDOWN[4])
problem.addConstraint(lambda sevenACROSS,fiveDOWN : sevenACROSS[2]==fiveDOWN[2])
problem.addConstraint(lambda threeDOWN,sevenACROSS : sevenACROSS[3]==threeDOWN[4])
problem.addConstraint(lambda sixDOWN,eightACROSS : eightACROSS[1]==sixDOWN[2])
problem.addConstraint(lambda twoDOWN,eightACROSS : eightACROSS[3]==twoDOWN[5])
problem.addConstraint(lambda fiveDOWN,eightACROSS : eightACROSS[4]==fiveDOWN[3])
problem.addConstraint(lambda threeDOWN,eightACROSS : eightACROSS[5]==threeDOWN[5])
solution=problem.getSolutions()
print(solution)
But it gives me this error
runfile('C:/Users/aliya/.spyder-py3/temp.py', wdir='C:/Users/aliya/.spyder-py3') Traceback (most recent call last):
File "", line 1, in runfile('C:/Users/aliya/.spyder-py3/temp.py', wdir='C:/Users/aliya/.spyder-py3')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/aliya/.spyder-py3/temp.py", line 50, in solution=problem.getSolutions()
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 271, in getSolutions return self._solver.getSolutions(domains, constraints, vconstraints)
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 567, in getSolutions return list(self.getSolutionIter(domains, constraints, vconstraints))
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 544, in getSolutionIter if not constraint(variables, domains, assignments, pushdomains):
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 991, in call self.forwardCheck(variables, domains, assignments)
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 935, in forwardCheck if not self(variables, domains, assignments):
File "C:\ProgramData\Anaconda3\lib\site-packages\constraint__init__.py", line 993, in call return self._func(*parms)
TypeError: lambda() takes 2 positional arguments but 8 were given
Any help regarding this!