Updated code, see description

Fixed casting pointer to int error and equals instead of assigning for
pattern setting.
Added RepeatPattern function
Changed main function flow
Added game winner to struct
Added game over handling
Changed network intializing