Write a program that draws a right-angled triangle. Use the +
sign to draw the triangle. The desired output should be as follows:
e.remove());
document.dispatchEvent(
new CustomEvent('setAceCode', { detail: code.innerText })
);
const lessonContentWrapper = document.getElementById('lessonContentWrapper');
if (lessonContentWrapper) {
lessonContentWrapper._x_dataStack[0].layout = 'editor';
}
$el.innerText = 'Moved!';
setTimeout(function () {
$el.innerText = 'Move to Editor';
}, 3000);
">Move to Editor
e.remove());
navigator.clipboard.writeText(code.innerText);
$el.innerText = 'Copied!';
setTimeout(function () {
$el.innerText = 'Copy';
}, 3000);
">Copy
1+
2+++
3+++++
4+++++++
5+++++++++
Type the program code on the next page and then run it. If the output result of your code is correct, submit it to earn the points for this exercise.
Solution Video
First, try to solve the question yourself; if you can't, watch the solution video: