This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes what is the correct translation of this ALGOL 60 code to Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "what is the correct translation of this ALGOL 60 code to Java?" Watch "what is the correct translation of this ALGOL 60 code to Java?" New topic
Author

what is the correct translation of this ALGOL 60 code to Java?

Ravi Shankarappa
Ranch Hand

Joined: Jan 09, 2010
Posts: 55
Here is the ALGOL 60 code:



Is the following translation correct?



In particular, I want to know if the code lr = shift + lr should be placed before a[lr]= x ?

Thanks in advance

-Ravi
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11168
    
  16

The best way to find out if it is correct is to test it...so what happens when you do that? Do you get the right answer?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Or you could read the Algol 60 spec... I googled up a copy which you can see here: http://www.brinckerhoff.org/clements/csc530-sp09/Readings/naur-1963.pdf. It describes how a for statement works in enough detail to answer the question.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what is the correct translation of this ALGOL 60 code to Java?
 
Similar Threads
MultiDimenaional Array sort
Help correcting a button behavior in swing
Boolean value not changing
Iteration using Newton Raphson's method
Processing with two JComboBox's in one JPanel/JFrame