Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: novice needs help

  1. #1

    novice needs help

    i have to make a game like

    5 4 8
    9 6 1
    2 3

    to be able to move the tiles from spot to spot...i got down to making the tiles appear randomly but the moving is giving trouble

    help meeeeee

    in pascal

  2. #2

    novice needs help

    I'd like to help you but first I have to see some code of yours since
    my magic crystal ball broke when I gave it away for cleaning.

    If you store your "board" in an array then moving is as easy as
    swapping two fields.

    Edit:
    Oops. You made me feel challenged by it and I wrote a similar game
    this night. Feel free to gather inspiration. If you don't understand a part
    just ask and I (or somebody else) will explain.

    http://nopaste.info/3f9d840950.html

    Note: Mixing the array this way makes the puzzle come out unsolvable
    very likely. So think of something else

  3. #3

    novice needs help

    Quote Originally Posted by waran
    I'd like to help you but first I have to see some code of yours since
    my magic crystal ball broke when I gave it away for cleaning.

    If you store your "board" in an array then moving is as easy as
    swapping two fields.

    Edit:
    Oops. You made me feel challenged by it and I wrote a similar game
    this night. Feel free to gather inspiration. If you don't understand a part
    just ask and I (or somebody else) will explain.

    http://nopaste.info/3f9d840950.html

    Note: Mixing the array this way makes the puzzle come out unsolvable
    very likely. So think of something else

    explaination is def needed, can u contact me via email, do u use messenger add me at romey1929@hotmail.com, whoever so desires to help me.thanksssssssss

    ima give u what i have so far so



    EDIT:

    THIS IS WHAT I HAVE

    http://nopaste.info/21e7695114.html

  4. #4

    novice needs help

    Why did you start another thread? You can edit your post, too.
    As for me I refined my code a bit. It should be easier now:

    http://nopaste.info/e527f05456.html

    Back to your code:
    You really have to ask more precisely where exactly your problem
    lies / which code fragment doesn't work as you expect.

    Much like the friendly admin in the other topic wrote: Its not like writing
    "help" and you get a full working code including documentation .)
    I merely wrote the game by myself because I felt bored.

    And for gods sake indent your code. My eyes hurt from guessing what
    belongs to what (this distracts me from finding your mistakes ).
    Btw.: I guess nobody is going to EMail or IM you. A Forum is meant to
    share wisdom; its not some market where you can buy your personal
    debugger.

  5. #5

    novice needs help

    ...ha!

    wat is php?

  6. #6

    novice needs help

    Just forgot to change it before posting; the code is in pascal nonetheless.

  7. #7

    novice needs help

    whats the difference between the first and second one u did....addition or totally different thing to work betta?

  8. #8

    novice needs help

    The second one has some slight improvements. Mainly it uses more
    modularity (complex problems broken down into small procedures) so its
    easier for you to understand.
    You can deduce from the function names what I do - also I commented
    the "IsMoveValid"-Part better. It might look strange, but if you think
    about it its actually easy.

    Also it doesn't randomize the game-board at startup but uses a static
    starting situation (since the "wild" randomization can produce unsolvable
    puzzles, as I wrote before). I made this one by myself and its solveable
    in 10 moves.

    But actually you should see the differences?

  9. #9

    novice needs help

    i was going through it, making sense of it but I guess how we were taught makes it difficult to read. but when i do run it it does give the option to have the tiles moved or anything, everytime i runs it goes str8 to ...what i mentioned above.

    i am not just trying to have u do my stuff for me, i have tried lots of stuff, but we werent taught what we shoul dhave been, the class was rushed, hence the reason why i resorted to seekig help online.

  10. #10

    novice needs help

    It seems like your problem is you are not familar with pascal.
    In this case you should seek help here:

    http://www.taoyue.com/tutorials/pascal/index.html

    I can't get what you mean by
    but when i do run it it does give the option to have the
    tiles moved or anything, everytime i runs it goes str8 to ...what
    i mentioned above.
    Its gibberish. You can compile my code with Freepascal (delphi or
    objfpc mode) or Delphi - maybe newer Turbo Pascal versions also -
    and run it.
    The program runs in console and you enter the number you want to
    move and press enter.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •