Home > Back-end >  simple method to print star pyramid with minimal code in dart?
simple method to print star pyramid with minimal code in dart?

Time:07-18

What is the simplest method to print star pyramid with minimal code? It shouldn't use more than one looping statement. I've produced pyramids with nested loop but I need more leaner code.

CodePudding user response:

  int row = 5;
  for(int i = 0;i<row;i  ){
    stdout.writeln(" "*(row-i) "* "*i);
  }
  •  Tags:  
  • dart
  • Related