Esoteric .NET Language Challenge

It's Friday afternoon, I'm bored with "conventional languages" such as C# and VB, so let's play a game! I've got four different code snippets from somewhat esoteric languages. They've only one thing in common - they can all be compiled with a .NET compiler into intermediate language. Can you guess a) what language each is, and b) what the snippets actually do?

I'll reveal the answers and the compilers in a couple of days if there's anything nobody can get! In ascending order of difficulty, then:

Snippet 1

 <%@ page language="#omitted#" %>
<script runat="server">
<font size="<%=FONT-SIZE%>">Nostalgia with a disturbingly novel twist...</font> <br>

This is fairly straightforward, I think.

Snippet 2

 ! This is the main program
Program MultiDog
use System
use VirtualDog
type (Dog) :: d
type (Greyhound) :: g
type (Labrador) :: l
call d%RollOver()
call g%RollOver()
call l%RollOver()
end program MultiDog

A little bit less obvious in terms of the language, but its meaning is pretty clear.

Snippet 3

 <%@ page language="#omitted#" %>
<script runat="server">

      <H1>Can you guess what I do?</H1>
      <form runat=server>
         <asp:Button id="Pressme" Text="Press Me" runat="server" OnClick="Reverse" />

In this one, the language is a giveaway but it takes more skill to work out what the code is doing!

Snippet 4

   400 constant bar

   : foo \ Performs a mystery operation
       over over mod 0= 0=
       rot rot dup >r
       over 2 / > 0=
       rot and r> swap
     over 2 / >
   : main \ Entry point
     ."Values up to " bar . .": "
     limit 1 do
             i foo
             if i . space then

This is much harder to get right, I think...

Let the challenge commence 🙂

Comments (11)

  1. Hi,

    I think number 1) is COBOL, number 2) might be Smalltalk, no idea about the other two though 🙂

    I havent programmed in either, but I tried googling on the syntax to see what was brought back.

  2. 1. COBOL, 3. APL, 4. FORTH

    I think…

  3. Neil says:


  4. Russ C. says:

    Educated Guesses

    1) Cobol

    Sets a the font size to 9pt

    2) SETL

    instantiates 3 classes in VirtualDog and makes them roll over 🙂

    3) APL

    Reverses the Array Args

    4) Forth

    Err … Some kinda loop 🙂

  5. Tim Sneath says:

    Some of you are doing well at guessing the languages – but still a little way to go in terms of the operations performed by each!

  6. Raymond Chen says:

    There’s a bug in the Fo(u)rth snippet. The "2 2" line should be just "2". Also if you aren’t worried about integer overflow (and you shouldn’t be, given the algorithm) you can speed up the search significantly by changing the loop condition. I also added comments as hints for other puzzle-solvers.

    : foo a

    2 begin a b

    2dup mod 0= 0= -rot mod a b

    2dup dup * > 0= mod a b stop

    rot and a b f

    while 1+ repeat

    dup * < ; result

    note: untested; there may still be bugs

  7. Tim Sneath says:

    Thanks Raymond 🙂 If I’ve edited that duplicate 2 out once, I’ve edited it out ten times. There’s some funny bug in the HTML editor, I think, as it just wouldn’t stick. Hope it’s now fixed for good.

  8. Woohoo,

    1) COBOL : Which is nice. Displays "Nostalgia with a disturbingly novel twist…" in increasing font sizes from 5 to 7. I think 5 is the staring point

    2) Isn’t smalltalk, the comments look wrong, and making 3 different types of dog, inherited from the dog class rollover. Where’s the "beg for biscuit" method? 🙂 Now the only thing I can remember using ! for comments is Fortran90, so Lahey’s

    3) Is APL, and maybe reverses the args on the query string?

    4) Forth. And I only just remember the Jupiter Ace, as the only consumer computer in the early eighties which used forth instead of basic 🙂 Caculating mystery operation on all values up to 400. Aggh, stack manipulation

  9. Somebody should implement INTERCAL.NET

  10. Steve Hiner says:

    Looks like others beat me to it. The only one I know is number 2. It’s Fortran. Though I never use FORTRAN or Fortran professionally it’s the first "real" language I used so I’ve been keeping an eye on it for years. Maybe someday I’ll get a project that requires heavy duty calculations and I’ll have an excuse to install my copy of Fortran.NET.

  11. Tom Guinther says:

    Sadly, raymond spoiled my answer on the 4. "Forth" entry. Looks loke 1. COBOL, 2. FORTRAN, and 3. some perversion of Prolog. Wish I had time to do the rest of the challenge. Thanks for the mental break though.


Skip to main content