Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I don't know how to use this easy loop . Please Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smallpudding




PostPosted: Wed Feb 19, 2014 9:23 pm   Post subject: I don't know how to use this easy loop . Please Help

What is it you are trying to achieve?



What is the problem you are having?
<We are supposed to write a program and its output shall look like this:
rrrrr
rrrr
rrr
rr
r
so basically, a letter repeats, and everytime there is a space at the beginning>


Describe what you have tried to solve this problem
<for x:1..5
put "r"
end for>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<for, end for>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Turing 4.1.1>
Sponsor
Sponsor
Sponsor
sponsor
smallpudding




PostPosted: Wed Feb 19, 2014 9:24 pm   Post subject: RE:I don\'t know how to use this easy loop . Please Help

RRRRR
spacex1RRRR
spacex2RRR
spacex3RR
spacex4R
Insectoid




PostPosted: Wed Feb 19, 2014 10:35 pm   Post subject: RE:I don\'t know how to use this easy loop . Please Help

You want to output 5 lines. You need a loop for that. Each of those lines is 5 characters long. You need a loop inside the first loop to do that. Now you need a way to decide whether to output a space or an R. You can probably use some math for this. Might have something to do with the for loop counter variables.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: