/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@PadonakApr 20.2014 — try posting in the [I][B]Free Homeworks[/B][/I] section
Copy linkTweet thisAlerts:
@Kevin2Apr 20.2014 — try posting in the [I][B]Free Homeworks[/B][/I] section[/QUOTE]

Too funny! ?
Copy linkTweet thisAlerts:
@jedaisoulApr 21.2014 — 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...
  • Copy linkTweet thisAlerts:
    @PadonakApr 21.2014 — :D[/QUOTE]

    ?
    ×

    Success!

    Help @mo6709 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...