scanning_for_all_aims.py 613 Bytes
Newer Older
Ahmad Reza's avatar
Ahmad Reza committed
1
2
3
4
"""
This solution just scans for particles that are within 5 hops range and prints them out.
"""

5
#Standard Lib that has to be in each solution
Ahmad Reza's avatar
Ahmad Reza committed
6

Ahmad Reza's avatar
Ahmad Reza committed
7
def solution(world):
Ahmad Reza's avatar
Ahmad Reza committed
8
9

    all_matters_list=[]
Ahmad Reza's avatar
Ahmad Reza committed
10
11
    if world.get_actual_round() == 1:
        all_matters_list=world.get_particle_map_coords()[(0,0)].scan_for_matter_within(hop=5)
Ahmad Reza's avatar
Ahmad Reza committed
12
13
14
15
16
        for list in all_matters_list:
            if list.type=='particle':
                print ("particle at", list.coords)
            elif list.type=='tile':
                print("tile", list.coords)
17
18
            elif list.type=='marker':
                print("marker", list.coords)
Ahmad Reza's avatar
Ahmad Reza committed
19