9
Guess the Language: #9 (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by Ategon@programming.dev to c/trivia@programming.dev
import std.stdio;

void main()
{
    writeln("Enter a number:");
    int input;
    readf("%d", &input);
    writeln("Factorial:", factorial(input));
}

int factorial(int n)
{
    if (n <= 1)
        return 1;
    return n * factorial(n - 1);
}

Options: Vala, Crystal, D, Nim

Use the following link to guess an answer, answer + results posted in 12 hours. (If you say the answer in the replies please put it in spoiler tags)

https://strawpoll.com/Qrgebk7PKZp

top 8 comments
sorted by: hot top controversial new old
[-] kool_newt@lemm.ee 2 points 1 year ago

Wow never heard of Vala. I choose that one.

[-] Yearly1845@reddthat.com 2 points 1 year ago* (last edited 1 year ago)

Vala is popular in the Linux world. It's goal is to make GUI programming easy in the gnome desktop environment. It transpiles to C.

[-] kool_newt@lemm.ee 2 points 1 year ago

Oh! I think I'll give it a whirl as a Gnome user.

[-] nebiros@programming.dev 1 points 1 year ago

I would say popular only ath gnome nerds niche, which is sad, cause is kind of cool

[-] Ategon@programming.dev 2 points 1 year ago

Click to show answerThe answer is D! 9/14 people guessed it right (64%)

[-] Tb0n3@sh.itjust.works 0 points 1 year ago

I made a slightly educated guess as on of the few languages I know is C and D is an attempt at being a successor.

[-] Tb0n3@sh.itjust.works 0 points 1 year ago* (last edited 1 year ago)

You had me until <. Is that a posting issue or actually part of the code?

Seeing as the screenshot has a < it's fairly obvious it's just lemmy.

[-] Ategon@programming.dev 1 points 1 year ago* (last edited 1 year ago)

Yeah thats a bug in lemmy-ui. It doesnt parse both less than symbols and ampersands properly in code blocks which can mess with code (< &) (&lt; &amp;)

this post was submitted on 16 Aug 2023
9 points (100.0% liked)

Trivia

235 readers
1 users here now

A place to quiz others with trivia questions related to the instance!

Please keep questions on the topic of trivia. If you have a question for how to do something please post it in a community relevant to what youre doing or !no_stupid_questions@programming.dev

Guidelines

Credits

Logo base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS