Last active
August 29, 2015 14:10
-
-
Save mikequentel/d74507a6c3738869150b to your computer and use it in GitHub Desktop.
How to Create a Text File List of RGB Values in Nim (aka Nimrod)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc main() = | |
var fp = open("true_colour_nimrod.txt", fmWrite) | |
var r = 255 | |
var g = 255 | |
var b = 255 | |
for r in countdown(255, 0): | |
for g in countdown(255, 0): | |
for b in countdown(255, 0): | |
fp.write(r) | |
fp.write(",") | |
fp.write(g) | |
fp.write(",") | |
fp.write(b) | |
fp.write("\n") | |
finally: fp.close() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nim (aka Nimrod) version of the same example in C http://mikequentelsoftware.blogspot.ca/2010/11/how-to-create-text-file-of-rgb-values.html