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..]]
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
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
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