Skip to content

Completed printing shapes exercises#2

Open
FulChr3356 wants to merge 5 commits intoplatformps:masterfrom
FulChr3356:master
Open

Completed printing shapes exercises#2
FulChr3356 wants to merge 5 commits intoplatformps:masterfrom
FulChr3356:master

Conversation

@FulChr3356
Copy link

No description provided.

@caoyr03
Copy link

caoyr03 commented Jun 29, 2020

Your code is so clear and neat! Very simple solutions


var topTriangle = "";
for (var i = length; i>0; i--){
topTriangle = topTriangle + getLine(i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename i to width to allow line 37 to be expressed with getLine(width);

var j = 1;
var size = length -1;
for (var i = 0; i < length; i++){
pyramid = pyramid + " ".repeat(size) + getLine(j) + " ".repeat(size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename j to width to line 53 to be expressed with getLine(width)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants