Commit c017b1e1 authored by Daniel Graungaard's avatar Daniel Graungaard
Browse files

Impelmented segment finder method

parent 7106bcb8
extensions [table]
breed[videos video]
videos-own [emotionelt utrolige-evner nuttethed humor energi completed-segments]
patches-own [empati-præference humor-præference utrolige-evner-præference nuttethed-præference]
......@@ -7,24 +7,31 @@ to setup
clear-all
reset-ticks
;top right - ældre
let segments table:make
;table:put segments "TOP RIGHT" (pxcor < 0 and pycor > 0)
;"TOP RIGHT" "TOP LEFT" "BOTTOM RIGHT" "BOTTOM LEFT"
;top left - pre-teens
ask patches with [pxcor < 0 and pycor > 0] [
set pcolor rgb 0 0 (random 255)
set utrolige-evner-præference number-from-interval [5 7]
set empati-præference number-from-interval [6 8]
set humor-præference number-from-interval [3 5]
set nuttethed-præference number-from-interval [6 8]
set empati-præference number-from-interval [3 5]
set humor-præference number-from-interval [8 10]
set nuttethed-præference number-from-interval [8 10]
]
; top left - pre-teens
; top right - ældre
ask patches with [pxcor > 0 and pycor > 0] [
set pcolor rgb (random 255) 255 255
set utrolige-evner-præference number-from-interval [5 7]
set empati-præference number-from-interval [3 5]
set humor-præference number-from-interval [8 10]
set nuttethed-præference number-from-interval [8 10]
set empati-præference number-from-interval [6 8]
set humor-præference number-from-interval [3 5]
set nuttethed-præference number-from-interval [6 8]
]
; bottom left - teens
......@@ -68,10 +75,10 @@ to setup
])
;husk at den samlede mængde point herunder ikke må overstige 30 point
set utrolige-evner 7
set emotionelt 3
set humor 4
set nuttethed 2
set utrolige-evner 10
set emotionelt 10
set humor 10
set nuttethed 10
set energi 10 ; Dette er den mængde energi videoen starter med
......@@ -96,10 +103,8 @@ end
to-report number-from-interval [interval]
let delta last interval - first interval + 1
report random delta + first interval
end
......@@ -115,21 +120,17 @@ to go
let average sum deltas / length deltas
(ifelse average <= 1 [
set energi energi + 5
] average <= 2 [
set energi energi + 3
] average <= 3 [
set energi energi + 1
])
if enegi > 50 [
if energi > 50 [
move-to-next-segment
show find-current-segment
stop
]
set label round energi
......@@ -145,7 +146,6 @@ to move ;turtle method
] [
right random 360
forward random 2
show "ELSE"
]
end
......@@ -156,7 +156,6 @@ to-report wall?
end
to-report groups
report ["TOP RIGHT" "TOP LEFT" "BOTTOM RIGHT" "BOTTOM LEFT"]
end
......@@ -174,6 +173,20 @@ to-report list-compare
end
to-report find-current-segment
(ifelse pxcor < 0 and pycor > 0 [ ;top right - ældre
report "TOP LEFT"
] pxcor > 0 and pycor > 0 [ ; top left - pre-teens
report "TOP RIGHT"
] pxcor < 0 and pycor < 0 [ ; bottom left - teens
report "BOTTOM LEFT"
] pxcor > 0 and pycor < 0 [ ; bottom right - voksne
report "BOTTOM RIGHT"
] [; in edge cases (if somehow we stand in a wall zone) this will be tru, we just do nothing and wait
report nobody
])
end
@#$#@#$#@
GRAPHICS-WINDOW
......@@ -228,7 +241,7 @@ CHOOSER
start
start
"TOP RIGHT" "TOP LEFT" "BOTTOM RIGHT" "BOTTOM LEFT"
3
2
BUTTON
117
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment