+28

# RANDOM CHALLENGE

Create a function which takes a limit as an argument and returns the random value between this two limits.. create this function without using default random library.. for example : input : random(2,10); random(2,10); random(2,10); random(2,10); output : 7 5 3 9 #Happy_Coding...

12/19/2017 4:24:21 AM

Nikky Amresh

+9

Here's mine. using lcg formula . plus a period test https://code.sololearn.com/Wq8uSyoVW3Wm/?ref=app

+17

Here's my try : https://code.sololearn.com/cY4XcC3LBc75/?ref=app

+12

@Brian not so effective I tried with rand(1,6) rand(1,6) it returns... 2 2 π

+12

My try, still far from perfect https://code.sololearn.com/cOh2wz0BGNsx/?ref=app

+11

@hareesh menikonda Yeah you can(<a href="Next_page.htm"><img src="img.png" /></a>)

+10

@hareesh menikonda With anchor tag (<a href="Next_page.htm">click me</a>) It seems you need to complete it first ..... It's a basic topic of html.. π https://www.sololearn.com/Course/HTML

+10

@Prashant Kumar {Intermediate} π //Without using default random library

+9

@hareesh menikonda Brother it's depends on application type.. yeah WEBSITES are surely dependent on html...

+9

its impossible i think i need to learn psedurandom number generator after googling .. π’ i giveup

+9

I have made a random template class in C++. It can return char, float, int and more. It takes 2 arguments: first is the minimum number, second is the range https://code.sololearn.com/c69x0TgNRMpo/?ref=app

+8

+8

ooh i didnt read question properly π

+7

Yeah @Brian... Without using random library

+7

@brian sure good idea

+7

@hareesh menikonda Here we go https://www.sololearn.com/Course/HTML

+7

https://code.sololearn.com/W2d1vPDF9PT2/?ref=app just a beta version of Math.random() in js it dont works 100% same as Math.random() function

+6

//javascript //too easy challenge just a litle maths skill //i have made a drafted code π function random(a,b){ return Math.random()*(a-b)+b; } random(4,-4); //generates a random value from 4 to -4

+6

Here is my try generates random number between a to b including b but not a. https://code.sololearn.com/cfaopRvp8wBf/?ref=app

+5

https://code.sololearn.com/cHB3iINrziRB/?ref=app

+5

If all parameters for random function are the same they are all have the same values since they are all run at the same time.My codes uses the current second count,not sure if it's effective