A Quine in Fortran 90
medium.com
A Quine in Fortran 90
1–10 of 14 posts
Re: A Quine in Fortran 90
#2Re: A Quine in Fortran 90
#3Re: A Quine in Fortran 90
#4Re: A Quine in Fortran 90
#5Re: A Quine in Fortran 90
#6I may be missing something, but isn't a quine trivial when you use a language that allows for file I/O (which I believe Fortran does have)? Or is the point of the "challenge" to avoid using file I/O?
Re: A Quine in Fortran 90
#7I may be missing something, but isn't a quine trivial when you use a language that allows for file I/O (which I believe Fortran does have)? Or is the point of the "challenge" to avoid using file I/O?
I could be wrong, as I only learned about the concept of a quine recently. But the way I understand it, it is good enough to simply output it. I suppose you could write to a file as well, but where would you write to? The wikipedia page for a quine has a lot of examples and all of them seem to simply output to stdout, just as I did. I don't think the challenge talks at any point about I/O, so I do think you can use i…
It feels like cheating, but it's also probably the easiest way to get a true quine which'll always work even if you modify parts of the code (while retaining the part of the program which ingests and prints out the file's contents).
Re: A Quine in Fortran 90
#8Earlier quoted context omitted.
I could be wrong, as I only learned about the concept of a quine recently. But the way I understand it, it is good enough to simply output it. I suppose you could write to a file as well, but where would you write to? The wikipedia page for a quine has a lot of examples and all of them seem to simply output to stdout, just as I did. I don't think the challenge talks at any point about I/O, so I do think you can use i…
I didn't mean that you could output to a file -- I meant that, knowing the name of the file the program is saved to (which is possible using facilities available in many modern languages, not sure about Fortran), you can ingest that file and print out its contents (to STDOUT for example). It feels like cheating, but it's also probably the easiest way to get a true quine which'll always work even if you modify parts o…
#!/usr/bin/env python2.7
print open(__file__, 'r').read()
Seems like cheating!Re: A Quine in Fortran 90
#9Earlier quoted context omitted.
I could be wrong, as I only learned about the concept of a quine recently. But the way I understand it, it is good enough to simply output it. I suppose you could write to a file as well, but where would you write to? The wikipedia page for a quine has a lot of examples and all of them seem to simply output to stdout, just as I did. I don't think the challenge talks at any point about I/O, so I do think you can use i…
I didn't mean that you could output to a file -- I meant that, knowing the name of the file the program is saved to (which is possible using facilities available in many modern languages, not sure about Fortran), you can ingest that file and print out its contents (to STDOUT for example). It feels like cheating, but it's also probably the easiest way to get a true quine which'll always work even if you modify parts o…
Re: A Quine in Fortran 90
#10Earlier quoted context omitted.
I could be wrong, as I only learned about the concept of a quine recently. But the way I understand it, it is good enough to simply output it. I suppose you could write to a file as well, but where would you write to? The wikipedia page for a quine has a lot of examples and all of them seem to simply output to stdout, just as I did. I don't think the challenge talks at any point about I/O, so I do think you can use i…
I didn't mean that you could output to a file -- I meant that, knowing the name of the file the program is saved to (which is possible using facilities available in many modern languages, not sure about Fortran), you can ingest that file and print out its contents (to STDOUT for example). It feels like cheating, but it's also probably the easiest way to get a true quine which'll always work even if you modify parts o…
A proper quine, though, doesn't require input.