Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 434.6k

How to use Random Function and Print the Characters colorful

Mar 16 2014 8:50 AM
 
 
First use random function to show three random numbers for viewers then use random function to choose the random series of numbers.
if the numbers which has been chosen be
 one of the random numbers which has been created by random function and the position of the chosen number is equal print the chosen number by user green else if the number which has been chosen by random function get equal  with the number which has been chosen by users print this number blue else print the chosen number by user black.
 
for example:
note: The random function  choose 10 series of numbers for this example.
black: Shows that the chosen number is not in this arrangement of numbers .
 green: Shows that the  chosen number and the position of that is in this arrangement.
 Blue: Shows that the chosen number is one of the arrangement's number but the position is not true.
the chosen number by random function
 6 8 9
the number which are entering by users(first serie)
 0 1 3
the number which are entering by users(second arrangement of numbers)
 4 5 3
the number which are entering by users(third arrangement of numbers)
 8 1 6
the number which are entering by users(forth arrangement of numbers)
 6 7 8
the number which are entering by users(fifth arrangement of numbers)
 6 8 0
the number which are entering by users(sixth arrangement of numbers)
 6 8 2
the number which are entering by users(seventh arrangement of numbers)
 6 8 1
the number which are entering by users(eighth arrangement of numbers)
 6 8 5
the number which are entering by users(ninth arrangement of numbers)
 6 87
the number which are entering by users(tenth arrangement of numbers)
 6 8 9
 

Answers (2)