For Programmers: Free Programming Magazines  


Home > Archive > Prolog > March 2006 > Adding numbers.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Adding numbers.
neilski_2003

2006-03-30, 5:28 am

Hi there guys,

I'm pretty new to this and am trying to get to grips with it - not being that great at maths isn't helping but i like a challenge anyway.

I only ask here because i am having difficulty finding understandable help on the internet - and if anyone knows of a good reference for this feel free to point me there if you'd rather not provide an answer.

Anyway, i have worked out how to use facts and query them, but what i would like to do is add two facts together so for example i could do the following

wtobh (6).
bhtot (4).

that would essentially describe a journey from w to t, but in order to do that i need to add the two numbers together. From what i have seen i think i should try and create a list and then add together whats in the list - is this correct? if so can anyone tell me a good resource for list definition etc.

Finally how would i write this to the screen - obviosuly write(wtobh) would output 'wtobh' so how do i access the numbers returned by a calculation or anything like that?

Cheers everyone. Once again - i know it is very basic and you may rather pass me to some tutorial that would help - but all your comments and help are much appreciated.

Thanks again

Neil
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com