我有一些代碼需要打印下劃線,但對於它上面的行,我該怎麼做?我不確定如何將下劃線打印到上一行,對javascript沒有太多經驗。謝謝!JavaScript打印到上一行
var landscape = function() {
var result = "";
var flat = function(size) {
for (var count = 0; count < size; count++)
result += "_";
};
var hill = function(size) {
result += " /";
for (var count = 0; count < size; count++)
result += ""+
"_";
result += " \\";
};
//BUILD SCRIPT
flat(3)
hill(4);
flat(6);
hill(1);
flat(1);
//END SCRIPT
return result;
it makes this ___ /____ \______ /_ \_`enter code here`enter code here`
and i want this
_____ ___
___/ \__/ \____/\_