Thread: learning C
View Single Post
  #3  
Old 01-31-2014, 07:45 PM
stormlord stormlord is offline
Planar Protector


Join Date: Nov 2009
Posts: 1,165
Default

If I recall, it's something like cout << " ##";

The ASCI for a space is 32 (decimal) I think.

Or is that c++?

I started with c or c++ in school, I forget. I used Turbo C++.

As far as the code is concerned, it looks simple to me. Each row above the bottom has (0+row) spaces. It looks like hte platform at the top is 2 characters in length. The width of the total pyramid can be estimated by (height+1). The number of blocks per row can be estimated by (width of the pyramid-spaces).

EDIT: I forgot about the role of printf in C.

You will probably want to loop printf(" "); to insert spaces on the line.
Insert pound signs the same way by looping printf("#"); and ending with printf("\n");

Honestly you just need to experiment with it.
__________________
Full-Time noob. Wipes your windows, joins your groups.

Raiding: http://www.project1999.com/forums/sh...&postcount=109
P1999 Class Popularity Chart: http://www.project1999.com/forums/sh...7&postcount=48
P1999 PvP Statistics: http://www.project1999.com/forums/sh...9&postcount=59

"Global chat is to conversation what pok books are to travel, but without sufficient population it doesn't matter."
Last edited by stormlord; 01-31-2014 at 08:16 PM..