Posts

Comments

Comment by Xianmin Chen (xianmin-chen) on GPT can write Quines now (GPT-4) · 2023-03-21T15:24:30.363Z · LW · GW

Can you write me a python script that does the following three things?
1) When you run it with no argument, it prints "Hello world" to standard out.
2) When you run it with an argument "-s", it prints its own source code.
As a constraint, I do not want the script to read or write to disk at all (so it can't get its source code by just reading the file that it's in).

Thanks if you can help with this! I'm curious to see how you do it.