scanning_for_all_aims.py 688 Bytes
Newer Older
Ahmad Reza's avatar
Ahmad Reza committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
This solution just scans for particles that are within 5 hops range and prints them out.
"""

import logging
from locale import str

NE = 0
E = 1
SE = 2
SW = 3
W = 4
NW = 5


direction = [NE, E, SE, SW, W, NW]

18
def solution(self, sim):
Ahmad Reza's avatar
Ahmad Reza committed
19
20
21

    all_matters_list=[]
    if self.get_actual_round() == 1:
22
        all_matters_list=sim.get_particle_map_coords()[(0,0)].scan_for_matter_within(hop=5)
Ahmad Reza's avatar
Ahmad Reza committed
23
24
25
26
27
28
29
30
        for list in all_matters_list:
            if list.type=='particle':
                print ("particle at", list.coords)
            elif list.type=='tile':
                print("tile", list.coords)
            elif list.type=='location':
                print("location", list.coords)