![]() |
|
|
|
#1
|
|||
|
hi all, i am having some trouble learning c. its for this class i am taking outside of school, and i want to do well. what i am having trouble with is figuring out how the syntax works.
is there anyone willing to help me learn some rudimentary principles? here is a link to the problem set. i am having trouble with the mario problem. can someone please explain how to put the blank spaces in, and also how to make new lines?
__________________
![]() | ||
|
|
|||
|
#2
|
|||
|
Read about whitespace and escape sequences in C =P
__________________
Jack <Yael Graduates> - Server First Erudite
Bush <Toxic> Jeremy <TMO> - Patron Saint of Blue | ||
|
|
|||
|
#3
|
|||
|
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..
|
|
||
|
#4
|
|||
|
Borland Turbo C++ lol - I used to use that.
He's probably expected to use printf/scanf, not cout/cin and the stream operators as they are from C++.
__________________
Jack <Yael Graduates> - Server First Erudite
Bush <Toxic> Jeremy <TMO> - Patron Saint of Blue | ||
|
|
|||
|
#5
|
||||
|
Quote:
What do you do with programming? I use it as a hobby. I took classes in colllege. My first exposure to it was when I was a sophmore in HS. I was using Qbasic. It's an easy language to start out. Alwys interested to hear from other programmer.
__________________
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:48 PM..
|
|
|||
|
#6
|
|||
|
__________________
Baalzy - 57 Gnocro, Baalz - 36 Ikscro, Adra - 51 Hileric, Fatbag Ofcrap - 25 halfuid Red99 Baalz Less - Humger, Baalzy - Ikscro If MMORPG players were around when God said, "Let there be light" they'd have called the light gay, and plunged the universe back into darkness by squatting their nutsacks over it. Picture courtesy of azeth | ||
|
|
|||
|
#7
|
||||
|
Quote:
thanks to everyone else for all the answers. this assignment isnt due for awhile, but im falling behind in my group due to my confusion. mainly im having a hard time figuring out how to write one algorithm that will print multiple lines based on user-input. ill read through these responses and hopefully i can come up with something.
__________________
![]() | |||
|
Last edited by phacemeltar; 01-31-2014 at 08:20 PM..
Reason: forgive my ignorance of terminology
|
|
|||
|
#8
|
|||
|
you should learn about variables, and then loops =) these are essential for solving this problem
__________________
Jack <Yael Graduates> - Server First Erudite
Bush <Toxic> Jeremy <TMO> - Patron Saint of Blue | ||
|
|
|||
|
#10
|
|||
|
Learn C#, download eqbrowser source, pras.
Learn C++, download Eqemu source, pras | ||
|
|
|||
![]() |
|
|