mardi 7 novembre 2017

How to generate a random pattern of *

Hello there i am making a program which will let me help generate a random string with a specified limit and random strings of *&# bu then the combination of *&# should not repeat.

Ex: if I input 3 then the O/P should be

#**
**#
**#

It should generate a random string of length 3 up to 3 rows with different patterns also the pattern should not repeat. I am using the below code but not able to attain it.

$n = 3;
for($i = 0; $i < n; $i++)
  {
     echo "*#";
  }

But I am not able to generate the output, where is my logic failing?

Aucun commentaire:

Enregistrer un commentaire