www.webdeveloper.com
Results 1 to 5 of 5

Thread: Code's sequence.

  1. #1
    Join Date
    Apr 2014
    Posts
    1

    Post Code's sequence.

    B.H
    I have an exertion how to write my idea in JavaScript,
    Well if does anyone could help that will be really appreciated.
    So my idea is:
    I have plenty of water (vast), two cups one is 3 ounce and the other one is 5 ounce.
    What I would like to do is fill up
    only 4 ounce which is mean to fill up the 3 ounce cup 3 times one time is fill it up and empty it into 5 ounce cup then full up at the second time the 3 ounce cup and empty it again into the 5 ounce cup then I have remainder of 1 ounce in the 3 ounce cup then what I will do is empty the 5 ounce cup then transfer the 1 ounce that I have left in the 3 ounce cup into the 5 ounce cup
    Avery time one of the cup are full I want to stop the water from fill it up so then I have no issue with the water.
    It's might sound a little complicated but is really that simple.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    try posting in the Free Homeworks section
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Oct 2013
    Posts
    517
    Quote Originally Posted by Padonak View Post
    try posting in the Free Homeworks section
    Too funny!

  4. #4
    Join Date
    Mar 2012
    Posts
    1,663
    What is the output supposed to be? I.e. Is the JS supposed to:

    1. Just demonstrate the solution, to show how it is done? (The easiest task) Or...

    2. Allow you to control an animation by pressing buttons that fill cups and transfer water, so you can work out/demonstrate the solution? (The moderate task) Or...

    3. Run through a sequence of moves until it finds the solution? This is the hardest task as it is much more complicated. E.g. How is it to choose the next move (random or sequentially)? How is it to avoid repeating patterns of moves that it has already tried? How to stop it getting into an endless loop of moves? Etc...

  5. #5
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    Quote Originally Posted by Kevin2 View Post
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles