We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Tough Tricky javascript question with array and random funtion

Thread ID:




123563 Mar 31,2016 03:04 AM JavaScript 0
Tags: General
Asked On March 31, 2016 03:04 AM

I got a tricky javascript question relating to random function and arrays, which I have ask around but no one seems to understand or able to solve.
For testing purpose, a fixed number value is hardcoded to the variable.
I would like to achieve the following result:
- 12 black stay fixed on "b" spot
- Followed by 53 red to be random place within only the 'r' spots on refresh or button click
('r' spot is every 3 row, first 15 box)
- Unfilled 'r' spots + rest of unfilled box fill with lightblue = 19, lime = 34, yellow = 17, pink = 42, green = 102 random position on refresh or button click
There should be no unfilled box
I trying my luck here, see who can solve it.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.