this post was submitted on 17 Apr 2025
119 points (96.9% liked)

Ask Lemmy

31095 readers
2132 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either [email protected] or [email protected]. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email [email protected]. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try [email protected] or [email protected]


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

Ok, Lemmy, let's play a game!

Post how many languages in which you can count to ten, including your native language. If you like, provide which languages. I'm going to make a guess; after you've replied, come back and open the spoiler. If I'm right: upvote; if I'm wrong: downvote!

My guess, and my answer...My guess is that it's more than the number of languages you speak, read, and/or write.

Do you feel cheated because I didn't pick a number? Vote how you want to, or don't vote! I'm just interested in the count.

I can count to ten in five languages, but I only speak two. I can read a third, and I once was able to converse in a fourth, but have long since lost that skill. I know only some pick-up/borrow words from the 5th, including counting to 10.

  1. My native language is English
  2. I lived in Germany for a couple of years; because I never took classes, I can't write in German, but I spoke fluently by the time I left.
  3. I studied French in college for three years; I can read French, but I've yet to meet a French person who can understand what I'm trying to say, and I have a hard time comprehending it.
  4. I taught myself Esperanto a couple of decades ago, and used to hang out in Esperanto chat rooms. I haven't kept up.
  5. I can count to ten in Japanese because I took Aikido classes for a decade or so, and my instructor counted out loud in Japanese, and the various movements are numbered.

I can almost count to ten in Spanish, because I grew up in mid-California and there was a lot of Spanish thrown around. But French interferes, and I start in Spanish and find myself switching to French in the middle, so I'm not sure I could really do it.

Bonus question: do you ever do your counting in a non-native language, just to make it more interesting?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 3 days ago (2 children)

If you didn't cheat that's actually pretty impressive.

[–] [email protected] 1 points 1 day ago* (last edited 1 day ago)

Yes I cheated. To be fair, I used each of those languages at one point and knew how to do it but was to lazy to look it up again.

Edit: except Fortran

[–] [email protected] 4 points 3 days ago (2 children)

It is astonishingly easy to get basically any LLM to output a simple iteration from one to ten function in all of those languages, and more.

Here's Assembly:

    newline db 0xA  ; Newline character

section .bss
    number resb 1  ; Reserve a byte for the number

section .text
    global _start

_start:
    mov ecx, 1  ; Start with 1
    mov edx, 10 ; End with 10

loop_start:
    cmp ecx, edx  ; Compare ecx with edx
    jg loop_end   ; If ecx > edx, jump to loop_end

    ; Convert number to ASCII
    add ecx, '0'  ; Convert number to ASCII
    mov [number], ecx  ; Store the ASCII value in number

    ; Print the number
    mov eax, 4        ; sys_write system call
    mov ebx, 1        ; File descriptor 1 is stdout
    mov ecx, number   ; Pointer to the number
    mov edx, 1        ; Number of bytes to write
    int 0x80          ; Call kernel

    ; Print newline
    mov eax, 4        ; sys_write system call
    mov ebx, 1        ; File descriptor 1 is stdout
    mov ecx, newline  ; Pointer to the newline character
    mov edx, 1        ; Number of bytes to write
    int 0x80          ; Call kernel

    sub ecx, '0'  ; Convert ASCII back to number
    inc ecx        ; Increment the number
    jmp loop_start  ; Jump back to the start of the loop

loop_end:
    ; Exit the program
    mov eax, 1        ; sys_exit system call
    xor ebx, ebx      ; Exit code 0
    int 0x80          ; Call kernel

Here's FORTRAN

program iterate_from_one_to_ten
    implicit none
    integer :: i

    ! Loop from 1 to 10
    do i = 1, 10
        print *, i
    end do
end program iterate_from_one_to_ten

Here's COBOL

PROGRAM-ID. IterateFromOneToTen.

ENVIRONMENT DIVISION.

DATA DIVISION.
WORKING-STORAGE SECTION.
    01  WS-Counter PIC 9(2) VALUE 1.

PROCEDURE DIVISION.
    PERFORM VARYING WS-Counter FROM 1 BY 1 UNTIL WS-Counter > 10
        DISPLAY WS-Counter
    END-PERFORM.

    STOP RUN.
[–] [email protected] 2 points 3 days ago* (last edited 3 days ago)

The assembly doesn't print 1-10, it prints 1-9 then :.

[–] [email protected] 1 points 3 days ago* (last edited 3 days ago) (1 children)

Why does that assembly code use a global variable for a loop value?? It's also ignoring register conventions (some registers need to be preserved before being modified by a function) which would probably break any codebase you use this in

[–] [email protected] 4 points 3 days ago

Because it was generated by an LLM that assumes this one to ten iteration function is the entirety of all of what the code needs to do.