#Visual difference between program and discord for example

28 messages ยท Page 1 of 1 (latest)

leaden fern
#

I'm making my homework where i need to do a simple tree like pattern with "*", However when i open it it doesn't work, but when i copy the outcome, it looks correctly on discord,
It should look like on discord, but Im afraid that when i turn it in, they'll say its wrong or something
code: #include <iostream>
using namespace std;

int main() {
double n;
cout << "Podaj n: ";
cin >> n;
for (double t = 1; t <= n; t++) {
for (double j = 1; j <= t; j++) {

        int spacja = n - j;        
        for (double s = 0; s < spacja; s++)
            cout << " ";
        for (double k = 0; k < j; k++)
            cout << "*";
        cout << "\n";
    }
}

}

vernal shadowBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

unique cobalt
#

paste your result in here

leaden fern
#



*


          •                          I need to separate the 4+ rows here because of discord feature
            
#

?

vernal shadowBOT
unique cobalt
#

hepp

#

!code

vernal shadowBOT
#
How to Format Code on Discord
Markup

```cpp
int main() {}
```

Result
int main() {}
unique cobalt
#
*
    *
   **
    *
   **
  ***
    *
   **
  ***
 * ***
    *
   **
  ***
 * ***
* * ***                             ```I need to separate the 4+ rows here because of discord feature
#

as you can see it looks the same here in discord as in your program

leaden fern
#

yeah...

#

not sure why it looks like before you type it in

#

do you maybe know how make it symetrical then?

unique cobalt
#

yup, but it's your assignment

#

you have all the tools you need to finish this assignment ๐Ÿ™‚

leaden fern
#

can you give me a hint at least?

hasty glade
#

The reason why it looked fine for you in discord is that the space symbol there is probably narrower than the *, while in the console they have the same width ๐Ÿ˜›

leaden fern
#

ohh

#

that solves one thing

hasty glade
#

Do you have a picture of how the tree should look?

leaden fern
#

yeah, one sec

#

I fixed it!

#

I just needed to add a space past "*" in the cout

vernal shadowBOT
# vernal shadow

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

unique cobalt
#

good job ๐Ÿ™‚