Extra Credit task

Extra Credit task preview image

1 collaborator

Default-person anjum iqbal (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.2 • Viewed 114 times • Downloaded 14 times • Run 0 times
Download the 'Extra Credit task' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [anjums anjum]
globals [trapped? ]

to setup
  ca
  ;as my registratsion number is 01-241171-005
  ; name isi anjum iqbal
  create-anjums 5 [
  setxy random-xcor random-ycor
    set color green
    set size 10
  ]
 ask patches [
 set pcolor white
 ]
  reset-ticks
 setup-name
  go
end 

to setup-name
;code for writing A
  ask patches with [pxcor >= -183 and pxcor < -180 and pycor > 12 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -183 and pxcor < -180 and pycor > 51 and pycor < 89 ][set pcolor red]
  ask patches with [pxcor > -182 and pxcor < -150 and pycor >= 89 and pycor < 92 ][set pcolor red]
  ask patches with [pxcor > -181 and pxcor < -150 and pycor >= 50 and pycor < 53 ][set pcolor red]
  ask patches with [pxcor >= -150 and pxcor < -147 and pycor >= 12 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -150 and pxcor < -147 and pycor > 51 and pycor < 89 ][set pcolor red]

  ;code for writing N
  ask patches with [pxcor >= -138 and pxcor < -135 and pycor >= 12 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -138 and pxcor < -135 and pycor >= 52 and pycor < 89 ][set pcolor red]
  ask patches with [pxcor >= -90 and pxcor < -87 and pycor >= 14 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -90 and pxcor < -87 and pycor >= 52 and pycor < 92 ][set pcolor red]
  ask patches with [pxcor >= -135 and pxcor < -113 and pycor >= 89 and pycor < 92 ][set pcolor red]
  ask patches with [pxcor >= -113 and pxcor < -110 and pycor >= 14 and pycor < 50  ][set pcolor red]
  ask patches with [pxcor >= -113 and pxcor < -110 and pycor >= 52 and pycor < 89  ][set pcolor red]
  ask patches with [pxcor >= -110 and pxcor < -90 and pycor >= 12 and pycor < 15 ][set pcolor red]



  ;code write for J
  ask patches with [pxcor >= -50 and pxcor < -47 and pycor >= 15 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -50 and pxcor < -47 and pycor >= 52 and pycor < 92  ][set pcolor red]
  ask patches with [pxcor >= -74 and pxcor < -50 and pycor >= 12 and pycor < 15 ][set pcolor red]
  ask patches with [pxcor >= -77 and pxcor < -74 and pycor >= 15 and pycor < 33 ][set pcolor red]


  ;code for writing U
  ask patches with [pxcor >= -38 and pxcor < -35 and pycor >= 15 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= -38 and pxcor < -35 and pycor >= 52 and pycor < 90 ][set pcolor red]
  ask patches with [pxcor >= 1 and pxcor < 4 and pycor >= 15 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= 1 and pxcor < 4 and pycor >= 52 and pycor < 90 ][set pcolor red]
  ask patches with [pxcor >= -35 and pxcor < 2 and pycor >= 12 and pycor < 15 ][set pcolor red]


 ;code writing for M
  ask patches with [pxcor >= 12 and pxcor < 15 and pycor >= 12 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= 12 and pxcor < 15 and pycor >= 52 and pycor < 87 ][set pcolor red]
  ask patches with [pxcor >= 62 and pxcor < 65 and pycor >= 12 and pycor < 50 ][set pcolor red]
  ask patches with [pxcor >= 62 and pxcor < 65 and pycor >= 52 and pycor < 87 ][set pcolor red]
  ask patches with [pxcor >= 14 and pxcor < 35 and pycor >= 87 and pycor < 90 ][set pcolor red]
  ask patches with [pxcor >= 35 and pxcor < 38 and pycor >= 44 and pycor < 88 ][set pcolor red]
  ask patches with [pxcor >= 38 and pxcor < 44 and pycor >= 42 and pycor < 45 ][set pcolor red]
  ask patches with [pxcor >= 43  and pxcor < 46 and pycor >= 44  and pycor < 88][set pcolor red]
  ask patches with [pxcor >= 45 and pxcor < 62 and pycor >= 87 and pycor < 90 ][set pcolor red]
end 

to go
  ask patches [
    if pcolor = black
  [set pcolor white ]
  ]
  ask anjums [
    rt random 20
    lt random 20
    fd 1

   ask patches in-cone 20 5
    [
      if pcolor = white
    [ set pcolor black]
    ]
]
  ask anjums [
;    face one-of patches with [pcolor = red]
;    fd 1
 let targ one-of patches with[pcolor = red]
 if targ != nobody [set heading towards targ fd 1]
  ]

tick
  ask anjums [ask patches in-cone 20 5  [
    if pcolor = red
    [set trapped? true ]


    ]
  ]
; if one-of patches with [ pcolor = white ]
   ;

  ask anjums with [pcolor = white]
  [set trapped? false ]
end 

There is only one version of this model, created over 6 years ago by anjum iqbal.

Attached files

File Type Description Last updated
Extra Credit task.png preview Preview for 'Extra Credit task' over 6 years ago, by anjum iqbal Download

This model does not have any ancestors.

This model does not have any descendants.