Welcome to CGI City - One of the biggest WWW Resources for CGI and Perl materials
Tips and Tutorials
How do I generate random number patterns without repeating?

Given a range of numbers, say 0 to 9, how does one generate a random pattern using all the digits but without repeating the occurence of a digit?

The following code gives the desired result:

Given the same range of numbers, how does one generate a 4-digit random pattern using all the digits but without repeating the occurence of a digit?

The following code gives the desired result:

The above codes may be modified to suit your own application.

-oOo-

Back to Tips and Tutorials


Search For:
Quick jump to
Home | About Us | Contact Us | Link To Us | Search
Tips & Tutorials | References | Books | Add A Resource
Custom Programming Services | Advertise
Disclaimer | Privacy Policy

Copyright © 1998-2099    CGI City    All Rights Reserved
All original materials contained herein including text, images, and original scripts written by CGI City, are copyrighted by CGI City. All other scripts and materials are copyrighted by their respective authors/owners.