Re: How to create a square grid like chess board???

From: tombolo (engsin_at_gmail.com)
Date: 10/19/04

  • Next message: Roberto Bagnara: "Any Prolog language lawyer out there?"
    Date: 18 Oct 2004 23:35:03 -0700
    
    

    Heath Hunnicutt <heath-usenet@removeThis.ofb.net> wrote in message news:<slrncn8dle.sjl.heath@ofb.net>...
    > On 2004-10-18, Bart Demoen <bmd@cs.kuleuven.ac.be> wrote:
    > | tombolo wrote:
    > |> Hi...
    > |>
    > |> i'm doing a small system for stowing cargo containers on a
    > |> vessel. The concept and positioning of stowing these containers are
    > |> the same as placing a chessman on one of the chessboard's cell. so,
    > |> how do i implement the rows and columns?
    > |
    > | Please try Google. "Prolog chess" does wonders !
    >
    > Oh, please.
    >
    > RFC CHARTER FOR comp.lang.prolog:
    >
    > 0.0 All posts requesting advice for prolog representations should be
    > immediately chastised. These posts are always form university
    > students attempting to avoid their assigned work. These posts are
    > never opportunities to spread the ideas of logic programming or
    > prolog.
    >
    > Anyway...
    >
    > I came across a solution to the Chess N-Queens problem here:
    > http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_11.html
    >
    > This is what many think of when they think of "Solving a chess
    > problem" with Prolog. However, the solution I reference takes
    > advantage of the fact that the problem space can be represented as
    > possible permutations, some of which satisfy the constraints.
    >
    > What about a 'real' problem. Suppose you want to put the heavy
    > containers on the bottom, but the ones that need electricity in
    > section A, and those which need cooling in A or B, and they need to
    > also be in a low-cost order to unload a certain order of ports?
    >
    > The solution can always be represented as a permutation of items in a
    > list for projects like this where there are a set number of pieces and
    > a set number of 'berths'. The question is how to search the
    > permutation space. Especially a real cargo ship, with perhaps 400
    > containers on it, has multiple real constraints and is a crazy
    > problem.
    >
    > |> Can anyone show me an
    > |> example? i heard it can be done using lists.
    > |
    > | Where did you hear that it can be done with lists ? It is most amazing
    > | that you got such precise information on the power of lists, because
    > | with lists, you can do "everything" (that can be done in any other
    > | reasonable programming language) ... So, where did you hear that ?
    >
    > Wow! Friendly!
    >
    > |> And one more thing, how do i tell the system to skip the occupied
    > |> cell?
    > |> By using the not/1 predicate?
    > |
    > | I wouldn't abuse not/1 for skipping occupied cells.
    > | Not/1 is too powerful and you might skip un-occupied cells by accident.
    > | Or worse, you might turn a seemingly un-occupied cell into an occupied
    > | one later on. Scary isn't it ?
    >
    > It would be scary if you had made it plain instead of meaningless.
    >
    > | One more person with a very low esteem of this newsgroup :-(
    >
    > Don't beat yourself up.
    >
    > Heath

    Thanks to both of you for your help. i'm eng sin. i guess you can see
    that from my email address. i'm postgraduate and currently doing my
    honours project. you'll be laughing out loud now coz postgraduate
    can't tackle problems like this. i'm from a southeast asia country
    where IT isnt a big thing yet like in Europe, States or Australia.
    There isn't a single college or uni here teaches prolog. i'm on my own
    to do this project as my lecturer is helping me in assessing my
    progress and starts deducting marks. does she know prolog? none of the
    lecturers in my college know about prolog.

    anyway, thanks again...

    for Bart...
    i'm might be a low esteem person but i can tell you i'll get this
    project done by my own. you are a bit arrogant and offensive at times
    and i understand that coz you are the one out there who is giving out
    helps. but always remember, you too will need helps from others one
    day. hope is not from those people whom you insulted.

    opps...if i'm overboard. sorry bout that...

    CHEERS dude.


  • Next message: Roberto Bagnara: "Any Prolog language lawyer out there?"

    Relevant Pages

    • Re: How to create a square grid like chess board???
      ... The concept and positioning of stowing these containers are ... |> the same as placing a chessman on one of the chessboard's cell. ... All posts requesting advice for prolog representations should be ... i heard it can be done using lists. ...
      (comp.lang.prolog)
    • Re: Adapting software to multiple usage patterns
      ... The library is part of "the language". ... I have written a handful of list implementations, ... had perfectly adequate implementations of both lists ... that is missing is a common interface for containers. ...
      (comp.lang.c)
    • Re: avoiding recursion in repr?
      ... >>Is there any equivalent function for defining new container classes ... >>written in Python, or do potentially recursive containers have to be ... but __repr__ for standard containers. ... code for lists and dictionaries correctly, ...
      (comp.lang.python)
    • Re: Adapting software to multiple usage patterns
      ... you can use it with lists, arraylists (flexible arrays) and all ... *sequential* containers. ... Ive wanted to iterate over all the elements of a hash in a language which has hashes natively, whilst at other points using it as a hash. ...
      (comp.lang.c)
    • Re: Adapting software to multiple usage patterns
      ... you can use it with lists, arraylists (flexible arrays) and all ... *sequential* containers. ... Ive wanted to iterate over all the elements of a hash in a language which has hashes natively, whilst at other points using it as a hash. ...
      (comp.lang.c)