Lab 8
Lost and Found in Translation

Objectives

The Story

You've been on a archaeological dig in the remote and ancient village of Caffienato, and you've found a pair of stone tablets with a manuscript carved into them. In discussions with Dr. Jones, the head of the site, you realize that the manuscript on these tablets bears a striking resemblance to a manuscript on a pair of tablets discovered last year in the nearby Slitherlund site.

Because you're the one who first noticed the similarity, Dr. Jones has asked you to lead the translation team.

Here are the original tablets found in nearby Slitherlund:

And here are the new tablets found in Caffienato:

Step 0: Have a look around

Read both set of tablets (programs). As you read, pay close attention so as to notice similarities and differences between them.

Step 1: Help Dr. Jones

Dr. Jones has been trying to read the new tablets with great interest, but seems a bit lost. He's sent the following panicked email:

Dr Exactus,

I'm having a heck of a time understanding these new tablets. They seem to be describing how to play some sort of game with something called 'Dice', which the tablets we found last year also mentioned. I'm convinced by your argument yesterday that these are describing the same game, but they look so very different. I know you've been reading the tablets carefully, so maybe you can help me.

But first, just to make it easier to discuss, let's give names to the two languages. Let's use the name "Java" to refer to the language used in Caffienato and "Python" to refer to the language of Slitherlund.

Based on your reading and translation work, can you please answer the following questions:

  1. In Java, what's the equivalent of Python's "or"?
  2. In Java, what's the equivalent of Python's "print"?
  3. Is there Python equivalent to Java's '!' (and if so, what)?
  4. On the Java tablet, does "d6.getValue()" mean the same thing as "d6.get_value()" meant on the Python tablet?
  5. In Java, they seem to use "public" and "private" to mean something. Is there an equivalent in Python?
  6. In Python, indentation is used to indicate blocks. What do they do in Java to accomplish the same goal?
  7. In Java, what's the equivalent of Python's "self"?
  8. In Java documents, is the equivalent of "self" always required or can it be left out?
  9. What is the Java equivalent of Python's '__init__'?

Once again, thanks for your hard work on this important project. I look forward to your informed answers.

Sincerely and with great gratitude,

Indiana

Answer Dr. Jones's questions in an email. You might want to draft your answers carefully in a text editor before sending them. You can email your answers to me at cassa@union.edu and I'll forward them to Dr. Jones.

Ask for help if you're having problems!