KT
kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Sujal Kumar
// https://www.sololearn.com/Discuss/1073979
// Number Circle [Challenge]
// Here is a new kind of challenge !
// You have to draw a number circle !
// Like this:-
// 4
// 3 1
// 2
// Note:Only non-web languages are welcome.
// Hint:Use a number limit to draw the cirlcle properly.
// Best of Luck !
// Happy Coding !
// Initialize random number generator.
import java.util.Random
val random = Random()
//**************************************************
// Get a random number in the range
fun rand(from: Int, to: Int): Int {
return random.nextInt(to-from+1)+from
} // rand
//**************************************************
// Display circle with selected numbers in it.
fun display(num: Int) {
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run