re: Daily Coding Puzzles - Nov 4th - Nov 9th VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Monday Number Drills: Blue and red marbles (8 KYU): You've decided to write a function, guess_blue() to help automatically calculate whether you...
 

Go

func Guess(bStart int, rStart int, bGone int, rGone int)(probability float32) {
    var b = bStart - bGone
    var r = rStart - rGone

    probability = float32(b) / float32(r + b)
    return
}
code of conduct - report abuse