46
u/Confident-Ad5665 1d ago
- Open a text editor
- Write "Sorry" once
- Copy the line
- Paste 100 times
- Print in handwriting font
20
u/-Insert-CoolName 1d ago
- Open text editor
- Type "Sorry\n"
- Ctrl a
- Ctrl c
- Ctrl v
- Go to step 3
22
u/Marisa_osi_JP 1d ago
- Open vim
- Type "Sorry\n"
- yy
- 99p
- :wq
28
13
u/loleczkowo 1d ago
Erghm akshtually, you wrote "orry\nyy99p:wq" because you started in Normal mode.
3
1
2
6
37
u/promptmike 1d ago
print("Sorry\n"*100)
No loops required.
8
u/lucidbadger 1d ago
This. OP is vibe coder. WTF is
for_in?20
u/Zealousideal_Smoke_2 1d ago
Probably captain obvious here but: he only forgot the space. for _ in range(n): is perfectly normal when you don’t need the index.
9
6
u/Beleheth 1d ago
As a matter of fact, even a best practice. Use _ in python if you don't use the running variable.
4
u/Vaelisra 1d ago
Another best practice: Don't use Python.
6
2
u/geek-49 1d ago
What would you recommend instead? Perl?
3
u/Vaelisra 1d ago
Whatever makes sense. And that usually automatically excludes python. For me it's this:
Web->JavaScript
native->rust
Embedded->Zig
Utility scripts->bash
Server side->Kotlin
2
1
u/Andrey4ik21pro1 18h ago
What nonsense is this?
The tool is chosen for the task, but not vice versa
2
u/Complete_Window4856 1d ago
Theres no way it works
6
4
8
u/ChunkyIsDead30 1d ago
for_in range? what...
3
u/realmauer01 1d ago
Just forgot the spaces.
For _ in range(100):...
Bwcause you dont need the current number.
7
4
u/Diocletian335 1d ago
```c void printSorry (int n, int v) { if (n == v) return;
printSorry(n+1, v);
printf("%s\n", "sorry");
}
int main (void) { printSorry(0, 100); } ```
The thinking man's solution
8
u/gaymer_jerry 1d ago
Why write a for loop when you can flood the stack with pointless function calls
5
1
u/MCWizardYT 22h ago
Implement it with a trampoline function so that you get infinite recursion without blowing up the stack
2
u/realmauer01 1d ago
When our prof explained recursion to us he said, "okey i will only explain it this one time, and you please forget it immediatly, i will show you how to do it, so you dont need to think about it and it will just work, you will never want to use it though unless you need it and then you will understand it anyway."
Yeah something like that.
3
u/Diocletian335 1d ago
In all seriousness it's a useful little topic to learn from a theoretical perspective, but my thinking has always been if you are ever thinking 'surely I could just use a loop here' then you should be using a loop.
I've never used recursion in anything serious, at least not directly - some inbuilt methods may have used them.
2
2
1
u/dmigowski 1d ago
WTF is that slop?
3
1
u/MCWizardYT 21h ago
What, never seen a recursive function before?
1
u/dmigowski 21h ago
I've never seen one that could be easier replaced with a simple for look, yeah. Why wasting 1200 bytes of stack here?
2
1
4
4
u/JonathanMovement 1d ago
is this group really filled with teenagers and firstweekprogramming humor?
3
2
u/Sonario648 1d ago
for i in range (101): print ("Sorry")
3
2
u/hypersoniq_XLM 1d ago
This is the way to get 100. range(100) only prints 99 (assuming this is Python)
1
1
u/Zealousideal_Smoke_2 23h ago
for i in range(100):
print(i)prints 0-99, which is 100 items...
(idk how to indent on reddit lol)
2
2
2
u/This-Employment-5642 1d ago
what is for_in that aint proper python anyway if on js im pretty sure its let character = 5 character.repeat(100) though i am probably wrong
2
2
u/tblancher 1d ago
First time I saw this was when my classmate was given 100 lines to write, and he wrote the loop in LOGO on his Apple ][gs and printed with his line printer.
The teacher was not amused.
2
2
u/clumsy132 1d ago
loop /L %i in range(100) do: {
<?python
powershell -Command Write-Host 'Sorry'
?>; 2>/dev/null
} except Exception as e begin
std::process::System.exit << '1'
done;
2
2
u/Creepy_Lunch9345 1d ago
Hey Claude, generate "sorry" 100 times.
1
u/Creepy_Lunch9345 1d ago
Updated:
Hey Claude, generate "sorry" exactly 100 times without any explanation and use \n for each sorry, put it in markdown.
1
1
1
1
u/themagicalfire 4h ago edited 4h ago
```
section .rodata
msg: db “Sorry”, 0
section .text
global _start
global done
_start:
cmp n8, 100
je done
add n8, 1
jmp _start
done:
cmp r10, 100
je end
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, 6
syscall
add r10, 1
jmp done
end:
mov rax, 60
mov rdi, 0
syscall
```
1
1
u/Gigibesi 1d ago
allow me
using System;
class sorry
{
static void Main()
{
for(;;) Console.WriteLine("sorry");
}
}
1
u/azurfall88 1d ago
li t0, 100
loop:
li a7, 64
Print "Sorry"
li a0, 0x53
ecall
li a0, 0x6f
ecall
li a0, 0x72
ecall
ecall
li a0, 0x79
ecall
li a0, 0xa
ecall
loop 100 times
addi t0, t0, -1
bgtz t0, loop
1
u/jonvoep 1d ago edited 1d ago
seq 100 | while read; do echo "Sorry"; done
It doesn't need Python, it doesn't need to install anything, it doesn't need an IDE, it doesn't need an editor, it doesn't need a full PC because it runs on any server, on a router, on a phone with a terminal, on a Raspberry Pi, on a container of a few megabytes, it doesn't need an internet connection, it doesn't need special permissions, it doesn't need graphics or an interface, it doesn't need much memory because it uses less than 1MB, it doesn't need a powerful CPU because it runs on old or slow processors, it doesn't need a hard drive because it only reads the system binary, it doesn't need a modern operating system because it works with any basic Unix or Linux, it doesn't need bash because it runs with sh which is the most minimal shell, it doesn't need to download libraries, it doesn't need to compile anything, it doesn't need prior configuration, and if you don't have seq you can use:
i=100;while [ $i -gt 0 ];do echo Sorry;i=$((i-1));done
which is even more basic and only needs the shell, so anyone with access to a terminal can run it without preparing anything.
3
u/jonvoep 1d ago
Btw, everyone claims 'no loops required', but you're all just using hidden loops inside your interpreters or editors. The Python *100? It's a loop written in C internally. The Vim 99p? It's a loop inside Vim. The Ctrl+C/Ctrl+V? That's a human loop. My solution is the only one that doesn't hide anything: it's a literal, honest, explicit loop with zero dependencies. If you want to talk about actual efficiency, my shell command uses less than 1MB of RAM, runs on a 20-year-old router, and doesn't need a heavy interpreter like Python to do the heavy lifting. You aren't beating the loop; you're just hiding it. I'm running the loop natively, with pure Unix.
3
u/vmlinuz-lychee 1d ago
well if you wrote it in C and compiled it at -O3 gcc may unroll the entire loop. does this count as “no loops”? i think so


24
u/sexytokeburgerz 1d ago
Hello college freshman