about | help | code help+videos | done | prefs |
genNumber
Given 4 boolean values a, b, c, and d, each one has a corresponding number from 1 to 4. So a is 1, b is 2, c is 3, and d is 4. Create a number based on which variable is true and return the number. For instance: if only a, c, and d are true, the result of 134 needs to be returned. genNumber(true, true, true, true) → 1234 genNumber(false, false, false, false) → 0 genNumber(true, true, false, true) → 124 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 170
Copyright Nick Parlante 2017 - privacy