Professional Documents
Culture Documents
3.1 Workshop Lec2 Summary PDF
3.1 Workshop Lec2 Summary PDF
3.1 Workshop Lec2 Summary PDF
Character encoding is described by the ASCII table. I chose to use the symbol represented by the
numeric code 178 in the ASCII table. For more information – there’s a section dedicated to text
representation in the second part – “C Programming Language STEP by STEP – Part 2” course.
Pay attention that I try to give a name to each number by defining an appropriate variable:
int racket_size = 8;
int racket_color = 178;
int ball_color = 'O';
int max_x = 79;
int min_x = 0;
int main()
{
int racket_size = 8;
int racket_color = 178;
int ball_color = 'O';
int max_x = 79;
int min_x = 0;
for (int y = 0; y < racket_size; y++)
{
gotoxy(min_x, y);
printf("%c", racket_color);
}
return 0;
}
)the comes in addition to the includes and the definition of gotoxy that come before the main – see
in the previous lecture summary the code for them!)
Cheers!
Shmuel.