Friday, August 1, 2014

Problem 56 - J'utilisais Linotte pour cette probleme

I have used a number of different programming languages by now. All sorts of different paradigms, different models of computation, different weird twists. However, in one feature, all languages that I have used have fallen into one of two groups: purely symbolic languages and English-based languages. None of the languages that I have used have had syntax based on another language. Despite the existence of plenty of non-English languages in this world, not too many non-English programming languages are very popular. However, today I came across some. I decided to try my hand at Linotte, as it was in French, a language that I took for 5 years (that is 3 years of middle school plus two of high school, so not as impressive as it may seem), but more important than that, Linotte, unlike many of the other non-English languages, was in a language using the Latin alphabet, and didn't stop development over a decade ago.

Using Linotte was surprisingly easy, it has a very C-like syntax, other than using a lot of French words. This was a pretty fun language to use, and I may try to use other similar languages in the future. The only real difficulty I had with Linotte is commented below - its division operator seemed to not work :( .

I wrote and ran my Linotte code in an IDE that came with the language (which was useful mostly because of code examples to copy accents from), so I don't have precise timing information, but the below code runs in a pretty short amount of time on my machine.
/** Je parle le français juste un peu*/
 
globale
i est un nombre
j est un nombre
p est un nombre
t est un nombre
somme est un nombre
résponse est un nombre valant 0
E56:

début
    ~ précision 0
    pour i de 1 à 99, lis
        pour j de 1 à 99, lis
            p vaut i puiss j
            somme vaut 0
            tant que p > 0, lis
                t vaut p mod 10
                somme vaut somme + t
                /* division seems impossible */
                p vaut entier (p * 0.1)
            ferme
            si somme > résponse, lis
                résponse vaut somme
            ferme
        ferme
    ferme
    Affiche résponse

3 comments:

  1. Thank you for having used Linotte and resolved a problem with!
    But I do not understand the problem with the division ? I want to fix this horrible bug....

    /** Je parle le français juste un peu*/

    globale
    i est un nombre
    j est un nombre
    p est un nombre
    t est un nombre
    x est un nombre
    somme est un nombre
    résponse est un nombre valant 0

    E56:
    début
    ~ précision 0
    pour i de 1 à 99 lis
    pour j de 1 à 99 lis
    p vaut i puiss j
    somme vaut 0
    tant que p > 0 lis
    t vaut p mod 10
    somme vaut somme + t
    p vaut entier(p / 10)
    ferme
    si somme > résponse lis
    résponse vaut somme
    ferme
    ferme
    ferme
    Affiche résponse

    ReplyDelete
  2. Thank you for your comment, I agree that it seemed like a very bad bug at time, that my program failed simply because it was doing a division!

    However,

    I just went to the Linotte website and re-downloaded the IDE, changed the * 0.1 to a / 10, and the program worked. It seems like this must have been a bug that was fixed some time in the past year. I solved this problem over a year ago (and on a different machine, with an older version of Ubuntu), but it seems to work now!

    ReplyDelete
  3. Thank you ! I did not see the date (2014) . Sorry. Anyway , I am impressed with your work on this blog! bravo!

    ReplyDelete