Created
March 26, 2013 23:52
-
-
Save willnix/5250386 to your computer and use it in GitHub Desktop.
vortex0
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"encoding/binary" | |
"fmt" | |
"log" | |
) | |
type num [4]uint32 | |
func (n *num) sum() { | |
tmp := 0 | |
for i := 0; i < len(n); i += 1 { | |
sum += i | |
} | |
} | |
func main() { | |
conn, err := net.Dial("tcp", "vortex.labs.overthewire.org:5842") | |
if err != nil { | |
log.Fatal(err) | |
} | |
defer conn.Close() | |
bufReader := bufio.NewReader(conn) | |
var challenge num | |
err = binary.Read(bufReader, binary.LittleEndian, challenge) | |
if err != nil { | |
log.Fatal(err) | |
} | |
fmt.Printf("Sum: %s\n", challenge.sum()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment