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
import strutils | |
import std/[asyncfile, asyncdispatch, asyncfutures, os] | |
import times | |
var post = openAsync("post_" & $now().toTime().toUnix() & ".txt", fmWrite) | |
var error = openAsync("error_" & $now().toTime().toUnix() & ".txt", fmWrite) | |
var fail = openAsync("fail_" & $now().toTime().toUnix() & ".txt", fmWrite) | |
var auth = openAsync("auth_" & $now().toTime().toUnix() & ".txt", fmWrite) | |
var succ = openAsync("succ_" & $now().toTime().toUnix() & ".txt", fmWrite) | |
var users = openAsync("users_" & $now().toTime().toUnix() & ".txt", fmWrite) |
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
fahr = 0 | |
while fahr <= 500 | |
celsius = 5.0 * (fahr - 32.0) / 9.0 | |
kelvin = 273.15 + celsius | |
puts "#{fahr}\t #{celsius}\t #{kelvin}\t" | |
fahr += 1 | |
end |
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
def fahrToCels(fahr : Number) | |
celsius = 5 * (fahr - 32) / 9 | |
puts "The temperature #{fahr} Fahrenheit is #{celsius} in Celsius degrees." | |
end | |
input = STDIN.gets.to_i | |
fahrToCels(input) |
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
fn main() { | |
let lower = 0.0; | |
let upper = 300.0; | |
let step = 1.0; | |
let mut fahr = lower; | |
println!("Fahrenheit\tCelsius"); | |
while fahr <= upper { | |
let celsius = 5.0 * (fahr - 32.0) / 9.0; |