Solution of the problem Life,the Universe and Everything in two new programming language

Ok, I just solved the problem stated in http://www.codechef.com/problems/TEST by using two new programming language, Go and Lua.
Here goes the code,
GO:

package main

import "fmt"

func main() {
for value := 0; ; {
fmt.Scanln(&value)
if value == 42 {
break
}
fmt.Println(value)

}
}

And now for Lua:

local ans
ans = io.read()
ans = tonumber(ans)
while ans ~= 42 do
print(ans)
ans = io.read()
ans = tonumber(ans)
end

Well I admit, lua is a true beauty, where Go looks like a rough one.   Be with me via twitter to know my micro thoughts.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s