Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ravi Shankarappa
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Paul Clapham
Sheriff
Posts: 21129
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic