<commit_before># Copyright (c) 2015 phrack. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import random
import threading
from training_protocols.ITrainingProtocol import ITrainingProtocol 

class ShootDontShoot(ITrainingProtocol):
    def __init__(self, main_window, protocol_operations, targets):
        self._operations = protocol_operations

        self._operations.clear_shots()

        self._continue_protocol = True
        self._arena_dimensions = self._operations.get_projector_arena_dimensions()
        self._missed_targets = 0
        self._bad_hits = 0
        self._current_shoot_targets = []
        self._current_dont_shoot_targets = []
        self._wait_event = threading.Event()

        self._operations.add_shot_list_columns(("Target",), [60])

        if not self._operations.projector_arena_visible():
            self._operations.say("This protocol only works on the projector arena.")
        else:
            self._add_targets(self._current_shoot_targets, "training_protocols/shoot_dont_shoot/shoot.target")
            self._add_targets(self._current_dont_shoot_targets, "training_protocols/shoot_dont_shoot/dont_shoot.target")  
            self._operations.show_text_on_feed("missed targets: 0\nbad hits: 0")      

            self._new_round_thread = Thread(target=self._new_round,
                                          name="new_round_thread")
            self._new_round_thread.start()

    def _add_targets(self, target_list, name):
        # Put up between zero and three targets
        target_count = random.randrange(0, 3)

        for i in range(0, target_count):
            x = random.randrange(0, self._arena_dimensions[0])
            y = random.randrange(0, self._arena_dimensions[1])
<commit_msg>Can now generate 3 targets as documented. Will no longer let a target be more then 2/3 rd's off the screen. This is progress towards #136<commit_after># Copyright (c) 2015 phrack. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import random
import threading
from training_protocols.ITrainingProtocol import ITrainingProtocol 

class ShootDontShoot(ITrainingProtocol):
    def __init__(self, main_window, protocol_operations, targets):
        self._operations = protocol_operations

        self._operations.clear_shots()

        self._continue_protocol = True
        self._arena_dimensions = self._operations.get_projector_arena_dimensions()
        self._missed_targets = 0
        self._bad_hits = 0
        self._current_shoot_targets = []
        self._current_dont_shoot_targets = []
        self._wait_event = threading.Event()

        self._operations.add_shot_list_columns(("Target",), [60])

        if not self._operations.projector_arena_visible():
            self._operations.say("This protocol only works on the projector arena.")
        else:
            self._add_targets(self._current_shoot_targets, "training_protocols/shoot_dont_shoot/shoot.target")
            self._add_targets(self._current_dont_shoot_targets, "training_protocols/shoot_dont_shoot/dont_shoot.target")  
            self._operations.show_text_on_feed("missed targets: 0\nbad hits: 0")      

            self._new_round_thread = Thread(target=self._new_round,
                                          name="new_round_thread")
            self._new_round_thread.start()

    def _add_targets(self, target_list, name):
        # Put up between zero and three targets
        target_count = random.randrange(0, 4)

        for i in range(0, target_count):
            x = random.randrange(0, self._arena_dimensions[0] - 100)
            y = random.randrange(0, self._arena_dimensions[1] - 100)

{'fraction_non_alphanumeric': 0.08210137275607181, 'fraction_numerical': 0.012143611404435059, 'mean_word_length': 2.9926238145416226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4662064', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1053, 'n_words': 245}