Hi want to create a grid 5 by 5 and fill it randomnly with number using javascript. Can someone help?
techyworld 0 Junior Poster in Training
Recommended Answers
Jump to Postin actionscript I would make it with an array formatted to be understandable eg.
var grid = new Array(1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16, 17,18,19,20, 21,22,23,24);
Once you see that format its much easier to grasp how to make it up, i just done random numbers here since …
Jump to Post@techyworld,
Your script is completely wrong. It does NOT create a 2D array but rather create all-undefined-value array size of 10. But then you wrongly assign a value of 1 using an invalid index (not a number). Because JavaScript always trys to fix the user script, it insteads uses your …
All 7 Replies
JorgeM 958 Problem Solver Team Colleague Featured Poster
techyworld 0 Junior Poster in Training
Biiim 182 Junior Poster
techyworld 0 Junior Poster in Training
JorgeM 958 Problem Solver Team Colleague Featured Poster
Biiim 182 Junior Poster
Taywin 312 Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.