<commit_before>package main

import (
    "fmt"
)

type position struct {
    x, y int   
}

func main() {
    var target, thor position
    fmt.Scanf("%d %d %d %d\n", &target.x, &target.y, &thor.x, &thor.y)

    for {
        var direction string
        var difference position

        difference.y = target.y - thor.y
        difference.x = target.x - thor.x

        switch  {
         case difference.y < 0:
            direction += "N"
            thor.y--
         case difference.y > 0:
            direction += "S"
            thor.y++
        }

        switch  {
         case difference.x > 0:
            direction += "E"
            thor.x--
         case difference.x < 0:
            direction += "W"
            thor.x++
        }
        
        fmt.Println(direction)
    }
}<commit_msg>Ragnarok now makes use of multithreading<commit_after>package main

import (
	"fmt"
)

type position struct {
	x, y int
}

type result struct {
	value     int
	direction string
}

func GetDirection(a, b string, x, y, v int) <-chan result {
	ch := make(chan result)
	go func() {
		difference := x - y
		switch {
		case difference < 0:
			ch <- result{v - 1, a}
		case difference > 0:
			ch <- result{v + 1, b}
		default:
			ch <- result{v, ""}
		}
		close(ch)
	}()
	return ch
}

func main() {
	var target, thor position
	fmt.Scanf("%d %d %d %d\n", &target.x, &target.y, &thor.x, &thor.y)

	for {
		channel_b := GetDirection("N", "S", target.y, thor.y, thor.y)
		channel_a := GetDirection("E", "W", thor.x, target.x, thor.x)

		result_b := <-channel_b
		result_a := <-channel_a

		thor.y = result_b.value
		thor.x = result_a.value

		fmt.Println(result_b.direction + result_a.direction)
	}
}
{'fraction_non_alphanumeric': 0.14024749558043606, 'fraction_numerical': 0.004714201532115498, 'mean_word_length': 1.9075342465753424, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7169885', 'n_tokens_mistral': 662, 'n_tokens_neox': 598, 'n_words': 162}