Press escape to exit fullscreen

{{sketch.instructions}}

CC {{sketch.licenseObject.short}}

Archived Sketch

This sketch is created with an older version of Processing,
and doesn't work on browsers anymore.

View Source Code

Capture Screenshot

Coin Flipping Game

{{$t('general.by')}}
If you start with £2 and bet £2 every time on the flip of a coin, what is the probability of getting up to the £10? The game is played in the middle of the screen, if the red line hits the top black line the game is won, and if it hits the bottom black line the game is lost. The squares in the top half of the screen show the how many times the games ends at that number of coin flips. Red squares for a loss, green for a win. The red graph at the bottom shows the proportion of games won, with the black line being 1/10. The green, red, blue bars show the average flips before win, loss, either
We recovered an unsaved version of this sketch. Please review your changes below.

As a Plus+ Member feature, this source code is hidden by the owner.

  • {{co.title}}
    {{$t('sketch.mode-pjs')}} {{$t('general.learnMore')}}
    Select mode or a template
    {{liveCodeLink}}
    • {{l.url.substr(l.url.lastIndexOf('/') + 1)}}
    {{$t('sketch.layoutDescription')}}

    {{k.category}}
    {{k.label}}
    {{k.description}}

    {{$t('sketch.seeMoreShortcuts')}}

    Versions are only kept for 7 days.
    Join Plus+ to keep versions indefinitely!

    {{$t('general.joinPlus')}}


    {{$t('sketch.versionsSummarized')}}