I need some your comments for this lab exercise of mine:
-Our instructor told as to print an array of "pyramiding asterisks"
just like the one below:
*
***
*****
*******
Using only one(1) asterisk(*) on the source code.
---
He gave us 2 clues to experiment with,...
FIRST clue:
#include<stdio.h>
main()
{
int i;
clrscr();
for(i=0; i<=10; i++)
{
gotoxy(1+i, 17);
printf(" RAY");
delay(15000);
}
getch();
}
======
SECOND clue:
#include<stdio.h>
main()
{
int i;
clrscr();
for(i=0; i<=10, i++)
{
gotoxy(1+i, 1+i);
printf("*"
delay(15000;
}
getch();
}
-----------------------------------------
I made my own source code, but it seems so awkward and stupid !
#include <stdio.h>
main()
{
char A;
clrscr();
A = '*';
gotoxy(40,12); printf("%c", A); gotoxy(39,13); printf("%c", A);
gotoxy(40,13); printf("%c", A); gotoxy(41,13); printf("%c", A);
gotoxy(38,14); printf("%c", A); gotoxy(39,14); printf("%c", A);
gotoxy(40,14); printf("%c", A); gotoxy(41,14); printf("%c", A);
gotoxy(42,14); printf("%c", A); gotoxy(37,15); printf("%c", A);
gotoxy(38,15); printf("%c", A); gotoxy(39,15); printf("%c", A);
gotoxy(40,15); printf("%c", A); gotoxy(41,15); printf("%c", A);
gotoxy(42,15); printf("%c", A); gotoxy(43,15); printf("%c", A);
getch();
}
In fairness, it works...! Using only one(1) asterisk (*).
But of course, I need some of your comments and suggestions.
I kept on using "printf("%c", A);" -which is very impractical !
My queries on this matter raise some thoughts on:
1. "How do I tile a series of text(s) on the screen?"
2. "I know there's a simple source code,... what could be those new concepts?"
--
That's all,.. Thanks !!