Retired

Pick a Pair of Random Elements From A Given Range (retired)

Description:

This Kata is about picking two unique random elements from a given closed range. If the range has zero or one element then return nil.

Swift Standard Library has a greate methods to pick a random elements from a given range but any method to pick more than one at once.

The resulting method can be used in a Quiz Questions which asks to compare two numerical random elements from a pre-defined range.

Example: Given Closed Range: range = 0...10

correct result tuple:

  1. (0, 1)
  2. (1, 0)
  3. (10, 2)
  4. (3, 8) etc.

not correct result tuple:

  1. (0, 0)
  2. (3, 3) etc.
Fundamentals

Stats:

CreatedDec 9, 2019
Warriors Trained53
Total Skips2
Total Code Submissions84
Total Times Completed15
Swift Completions15
Total Stars2
% of votes with a positive feedback rating46% of 12
Total "Very Satisfied" Votes4
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes5
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Blazej SLEBODA Avatar
Ad