N queens problem

2002-08-25 Thread Jonata Goulart
This is the problem to figure out the n queens problem but I didn't understand it very well. Somebody can help me ? how legal and queens functions work? attack (l,c) (ll,cc) = l ==ll || (l+c==ll+cc) || (l-c==ll-cc) legal p m = and [not (attack (l,c) (m, length p +1)) | (l,c) - zip p [1..]]

questions

2002-08-20 Thread Jonata Goulart
I'm trying to do a simple lex analyser in haskell I defined the function lexi that is intended to break a string into tokens returning them as a list but I received the following error: ERROR TesteEval.hs:20 - Syntax error in input (unexpected symbol restante) isLetter:: Char - Bool isLetter

Leical and syntactic analyzer

2002-08-20 Thread Jonata Goulart
Does somebody know where can I find an example of a lexical and syntactic analyzer for arithmetic and conditional statements in Haskell? Thanks _ Chat with friends online, try MSN Messenger: http://messenger.msn.com

conditional

2002-07-22 Thread Jonata Goulart
How do I write a multiple tine conditional in Haskell. Example: This would work on language like C. if (x==1) { x = x +1; x = x +2; x = x +3; } Thanks. _ Chat with friends online, try MSN Messenger: http://messenger.msn.com