Skip to main content
added 163 characters in body
Source Link
Swift
  • 133
  • 5

This is the image i am editing (c) Image that I am editing, note, all sections have their own file.

This is the image i am editing (c) Image that I am editing, note, all sections have their own file.

added 130 characters in body
Source Link
Swift
  • 133
  • 5

[Edit] The error was related to a typo in my code. The suggestion provided reduced the time to do the functions by 2/3rds!!!!

[Edit] The error was related to a typo in my code. The suggestion provided reduced the time to do the functions by 2/3rds!!!!

included the error
Source Link
Swift
  • 133
  • 5

I realised there needs maybe some clarity about this traceback. run_function_tests() this has code to run a short test with my old code.

def run_engine_test(change_list):
for x in change_list:
    convert_colour(x[0], region_list.regions_d[x[0]][1], x[1])

change_list = [(n,random.choice(colour_list.colour_list)) for n in region_list.regions_d]

We also have a function called colour detect which will check for patterns in the colour

def colour_detect():
#Detect if colours in the image match the colours on the palette and re-maps the dictionary if a region colour is changed
    detected_colours = []
        for x in region_list.regions_d:
            region_colour = print_img_data(region_list.regions_d[x][0])
            region_list.regions_d[x] = [region_list.regions_d[x][0], region_colour]
        if region_colour not in detected_colours:
            detected_colours.append(region_colour)

This is intended to be run at the beginnig of a "game or round" and then in between the engine ticks when actions like wars are comitted. Hence why it checks all of the images to ensure that the dictionary has been updated correctly.

After that the traceback comes from your functions.

I realised there needs maybe some clarity about this traceback. run_function_tests() this has code to run a short test with my old code.

def run_engine_test(change_list):
for x in change_list:
    convert_colour(x[0], region_list.regions_d[x[0]][1], x[1])

change_list = [(n,random.choice(colour_list.colour_list)) for n in region_list.regions_d]

We also have a function called colour detect which will check for patterns in the colour

def colour_detect():
#Detect if colours in the image match the colours on the palette and re-maps the dictionary if a region colour is changed
    detected_colours = []
        for x in region_list.regions_d:
            region_colour = print_img_data(region_list.regions_d[x][0])
            region_list.regions_d[x] = [region_list.regions_d[x][0], region_colour]
        if region_colour not in detected_colours:
            detected_colours.append(region_colour)

This is intended to be run at the beginnig of a "game or round" and then in between the engine ticks when actions like wars are comitted. Hence why it checks all of the images to ensure that the dictionary has been updated correctly.

After that the traceback comes from your functions.

included the error
Source Link
Swift
  • 133
  • 5
Loading
edited body; edited tags; edited title
Source Link
200_success
  • 144.2k
  • 22
  • 188
  • 473
Loading
Source Link
Swift
  • 133
  • 5
Loading