int max = 18 ; // random max limit
string wcard_pattern = "*" ; // first pattern to display, using string is easy.
// by a for loop
for( i = 0 ; i < max ; i++ ){
// display about the first pattern, and at each loop lap :
console.writeline(wcard_pattern) ;
// end_display to console
// then we work on wcard_pattern content ( and values )
wcard_pattern += "*" ;
// equal to: wcard_pattern = wcard_pattern + "*" ;
// it's syntax shortcut
}
// reset of max , and reset of wcard_pattern
max = 25 ; // random value
wcard_pattern = "*" ; // 1 wildcard as start content
// by a while loop :
while( i < max && i++ ){ // 2 tests conditions are used.
// one check the total of wcard_pattern until i = max ( not always returning '1', when '0' it exit the loop )
// one operate an incrementation of i. ( function always returning '1' )
// as one of the two tests fails, it will exit the loop.
console.writeline(wcard_pattern) ;
wcard_pattern += "*" ;
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.