Computer Science Canada making a diamond with * |
Author: | kousha41564 [ Fri Dec 12, 2008 8:39 pm ] | ||
Post subject: | making a diamond with * | ||
hi , i am making a diamond with * (stars) and i did it after like 2 days of trying . but my code seems long and stupid, (programmer since 1 month, turing that is , i know html and basic) so here is the code, i was wondering if anyone could shorten it for me , if shortening it IS possible.
so the point of the program is asking how many lines the use would like, and then making a diamond based on that number of lines (twice that number of lines) |
Author: | ecookman [ Fri Dec 12, 2008 8:50 pm ] | ||
Post subject: | Re: making a diamond with * | ||
i don't think you can make the program shorter... turing is a horrible language to use you need long complex programs to do simple things as an example run this
good program though my program is not the final product. but it is the base if it didn't need to be shortened can't be shortened. Only 1 way to really to do something in turing |
Author: | dc116 [ Fri Dec 12, 2008 8:55 pm ] | ||
Post subject: | Re: making a diamond with * | ||
You can definitely make it shorter. Here's my version, using counters.
|
Author: | ecookman [ Fri Dec 12, 2008 9:05 pm ] |
Post subject: | RE:making a diamond with * |
well didn't really make it shorter just wrote another program that is probably beyond his knowledge if he is just starting... here at compsci we like to help people get the right answers not give it to them. if you examine his program it uses effective but simple for loops, which is in his area knowledge and understanding of he program next time try to point them to a tutorial that shows them how to use something or break down your code and show them how it works not *slap* done here you go. The point that i am getting at is teach someone how to do something not do it for them. ------------------------------------------------------- you are probably thinking that what i said was wrong. if he was looking for a alternative way to write his program i was wrong, but what he asked for is exactly what i gave. if what HE wrote can be shortened |
Author: | dc116 [ Fri Dec 12, 2008 9:10 pm ] |
Post subject: | RE:making a diamond with * |
Thanks for the advice, I'll keep that in mind next time. |
Author: | ecookman [ Fri Dec 12, 2008 9:12 pm ] |
Post subject: | RE:making a diamond with * |
no problem i got sooo many warning due to that. i think like 3...just saving you from bannage |
Author: | kousha41564 [ Sat Dec 13, 2008 11:00 pm ] |
Post subject: | RE:making a diamond with * |
dc16, what you wrote seems so genius to me ![]() ![]() and if i actualy wrote my program effeciently then i am proud of myself thank you! ![]() and ecooman thats a nice game man , if you can you should try incorperating some graphics |
Author: | TheGuardian001 [ Sun Dec 14, 2008 12:29 am ] | ||||
Post subject: | Re: making a diamond with * | ||||
the key thing you would need to use is the locate statement
locate moves the text output to the specified row and column. for example, a vertical line 5 columns from the right side would be
|
Author: | Tony [ Sun Dec 14, 2008 2:19 am ] | ||
Post subject: | Re: making a diamond with * | ||
ecookman @ Fri Dec 12, 2008 8:50 pm wrote: i don't think you can make the program shorter... turing is a horrible language to use
Since Turing is such a horrible language to use, I challenge you come up with a shorter solution in any other language. Your baseline? 6 lines
|
Author: | ecookman [ Sun Dec 14, 2008 11:06 am ] |
Post subject: | RE:making a diamond with * |
i don't know enough about other languages to do that sorry... i just know i hate turing and it is a pain to code anything |
Author: | DanielG [ Sun Dec 14, 2008 11:17 am ] |
Post subject: | RE:making a diamond with * |
Turing has many flaws, but amount of code needed to write an avergae program is not one of them. |
Author: | kousha41564 [ Sun Dec 14, 2008 12:13 pm ] |
Post subject: | RE:making a diamond with * |
tony, holy crap ! 6 lines, make me feel like a retard ![]() |
Author: | Tony [ Sun Dec 14, 2008 4:45 pm ] |
Post subject: | RE:making a diamond with * |
@ecookman -- other languages will hardly make drawing ASCII patterns any easier for you. I'm not sure how you've decided that Turing is so much worse and so much more "painful" than other languages, if you don't know enough about other languages to use them. @kousha41564 -- don't be. I'd take your solution over my own, as it's much easier to follow, understand, and maintain. |
Author: | kousha41564 [ Sun Dec 14, 2008 6:21 pm ] |
Post subject: | RE:making a diamond with * |
yay lol ![]() |
Author: | dc116 [ Sun Dec 14, 2008 6:28 pm ] | ||
Post subject: | Re: RE:making a diamond with * | ||
kousha41564 @ Sun Dec 14, 2008 12:13 pm wrote: tony, holy crap ! 6 lines, make me feel like a retard
![]() Ahh same here ![]() ![]() ![]() Here's the breakdown of my version, as requested.
Hope that helps |
Author: | kousha41564 [ Sun Dec 14, 2008 7:37 pm ] |
Post subject: | RE:making a diamond with * |
explain the repeat command to me ? |
Author: | kousha41564 [ Sun Dec 14, 2008 7:38 pm ] |
Post subject: | RE:making a diamond with * |
i havve read the help section of turing but i just dont get their definition of repeat |
Author: | ecookman [ Sun Dec 14, 2008 8:27 pm ] |
Post subject: | Re: RE:making a diamond with * |
Tony @ Sun Dec 14, 2008 4:45 pm wrote: @ecookman -- other languages will hardly make drawing ASCII patterns any easier for you. I'm not sure how you've decided that Turing is so much worse and so much more "painful" than other languages, if you don't know enough about other languages to use them
the other language i know is VB not vb.net just straight up VB i havn't figured out how to do that stuff in vb, but making games in vb...refer to [url] http://compsci.ca/v3/viewtopic.php?t=19530 [/url] i have done more... hoping to post it later on tonight or tomorrow |
Author: | dc116 [ Mon Dec 15, 2008 5:23 pm ] | ||
Post subject: | Re: RE:making a diamond with * | ||
kousha41564 @ Sun Dec 14, 2008 7:38 pm wrote: i havve read the help section of turing but i just dont get their definition of repeat
let's use this code for example
In this line, you're not outputting a single asterisk, but rather 7 (as indicated by the number inside the parenthesis). |
Author: | kousha41564 [ Mon Dec 15, 2008 11:07 pm ] |
Post subject: | RE:making a diamond with * |
OOOOO thank you very much |
: |