Tables with locate
Author |
Message |
yazdmich
|
Posted: Tue Sep 25, 2012 5:51 pm Post subject: Tables with locate |
|
|
What is it you are trying to achieve?
Make a table of outputs with locate
What is the problem you are having?
I don't know how to use locate
Describe what you have tried to solve this problem
I have no idea how to use locate
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
const pi := 3. 14159265
var height, volume, radius2, surface, height2 : real
put "Volume and Radius of a cone"
put "Variable is radius"
put "Height: " ..
get height
put "First column is radius, second column is height, third column is volume, fourth column is surface area"
for decreasing radius : 20 .. - 1 by 1
radius2 := radius * radius
height2 := height * height
volume := (1 / 3) * pi * radius2 * height
surface := pi * radius * (radius + sqrt (radius2 + height2 ))
put radius ..
put " " ..
put height ..
put " " ..
put volume ..
put " " ..
put surface
end for
var radius : real
put "Variable is Height"
put "Radius: " ..
get radius
put "First column is radius, second column is height, third column is volume, fourth column is surface area"
for decreasing height3 : 20 .. - 1 by 1
radius2 := radius * radius
height2 := height3 * height3
volume := (1 / 3) * pi * radius2 * height
surface := pi * radius * (radius + sqrt (radius2 + height2 ))
put radius ..
put " " ..
put height3 ..
put " " ..
put volume ..
put " " ..
put surface
end for
|
Please specify what version of Turing you are using
4.1 school |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Zren
![](http://compsci.ca/v3/uploads/user_avatars/1110053965512db6185954b.png)
|
Posted: Tue Sep 25, 2012 6:07 pm Post subject: RE:Tables with locate |
|
|
Have you read the documentation for that function/procedure? locate |
|
|
|
|
![](images/spacer.gif) |
yazdmich
|
Posted: Tue Sep 25, 2012 6:27 pm Post subject: Re: RE:Tables with locate |
|
|
Zren @ Tue Sep 25, 2012 6:07 pm wrote: Have you read the documentation for that function/procedure? locate
could I possibly get an example on how to use locate? I just swapped into ICS yesterday so I missed the last 2 weeks and can't find anything regarding locate in the notes the teacher gave me |
|
|
|
|
![](images/spacer.gif) |
Zren
![](http://compsci.ca/v3/uploads/user_avatars/1110053965512db6185954b.png)
|
Posted: Tue Sep 25, 2012 6:40 pm Post subject: Re: RE:Tables with locate |
|
|
yazdmich @ Tue Sep 25, 2012 7:27 pm wrote: Zren @ Tue Sep 25, 2012 6:07 pm wrote: Have you read the documentation for that function/procedure? locate
could I possibly get an example on how to use locate? I just swapped into ICS yesterday so I missed the last 2 weeks and can't find anything regarding locate in the notes the teacher gave me
The documentation provides an example... Open a new program and run the example there. Though since it uses random, it might be throwing you off. Here's another that's slightly more descriptive.
|
|
|
|
|
![](images/spacer.gif) |
QuantumPhysics
|
Posted: Wed Sep 26, 2012 10:37 pm Post subject: RE:Tables with locate |
|
|
Its actually very easy. The run-time screen breaks into a grid of sort. x by y locate(x,y) you simply put the position like you would on a cartesian plane, except the maximum x is 80 (not too sure) an the maximum y is 12 or maxx/maxy |
|
|
|
|
![](images/spacer.gif) |
Aange10
![](http://compsci.ca/v3/uploads/user_avatars/19166165534f400d42de502.png)
|
Posted: Thu Sep 27, 2012 7:56 am Post subject: RE:Tables with locate |
|
|
Quote: Its actually very easy. The run-time screen breaks into a grid of sort. x by y locate(x,y) you simply put the position like you would on a cartesian plane, except the maximum x is 80 (not too sure) an the maximum y is 12 or maxx/maxy
Your really making this all kinds of confusing. I know what it does and how to use it, and your still barely making sense.
locate is very simple. You put the (x,y) coordinates in the parenthesis, and the next put or get statement will be placed there. |
|
|
|
|
![](images/spacer.gif) |
|
|