<commit_before>package epfl.pacman
package behaviour

import scala.util.Random.{nextInt => randomInt}

import maze.MVC

abstract class Behavior {
  val mvc: MVC
  import mvc._

  type Filter = Directions => Directions

  abstract class NextMethod(model: Model, c: Figure) extends Function0[Option[Direction]] {

    def apply: Option[Direction]

    /**
     * Exposed DSL
     */
    val bouge = directions
    val Bouge = directions

    val reste = NoDirections
    val Reste = NoDirections


    // CONDITIONS

    def si(cond: => Boolean)(body: => Directions): Condition = {
        Condition(() => cond, () => body)
    }

    def siChasseur = si(model.pacman.hunter) _
    def siChassé   = si(!model.pacman.hunter) _
    def siChasse   = siChassé

    def siMonstrePrès = si(model.minDistBetween(model.pacman.pos, model.pacman.pos, positions(model.monsters), Set[Position]()) <  Settings.farDistance) _
    def siMonstrePres = siMonstrePrès
    def siMonstresLoin = si(model.minDistBetween(model.pacman.pos, model.pacman.pos, positions(model.monsters), Set[Position]()) >= Settings.farDistance) _

    def alterner(weight: Int) =
        si(weight < randomInt(100)) _
<commit_msg>new aliases<commit_after>package epfl.pacman
package behaviour

import scala.util.Random.{nextInt => randomInt}

import maze.MVC

abstract class Behavior {
  val mvc: MVC
  import mvc._

  type Filter = Directions => Directions

  abstract class NextMethod(model: Model, c: Figure) extends Function0[Option[Direction]] {

    def apply: Option[Direction]

    /**
     * Exposed DSL
     */
    val bouge = directions
    val Bouge = directions

    val reste = NoDirections
    val Reste = NoDirections


    // CONDITIONS

    def si(cond: => Boolean)(body: => Directions): Condition = {
        Condition(() => cond, () => body)
    }

    def siChasseur = si(model.pacman.hunter) _
    def siChassé   = si(!model.pacman.hunter) _
    def siChasse   = siChassé

    def siMonstrePrès = si(model.minDistBetween(model.pacman.pos, model.pacman.pos, positions(model.monsters), Set[Position]()) <  Settings.farDistance) _
    def siMonstresPrès = siMonstrePrès
    def siMonstrePres = siMonstrePrès
    def siMonstresPres = siMonstrePrès

    def siMonstresLoin = si(model.minDistBetween(model.pacman.pos, model.pacman.pos, positions(model.monsters), Set[Position]()) >= Settings.farDistance) _

    def siMonstreLoin = siMonstresLoin

    def alterner(weight: Int) =
        si(weight < randomInt(100)) _

{'fraction_non_alphanumeric': 0.10959454034524288, 'fraction_numerical': 0.003211561621838619, 'mean_word_length': 3.434163701067616, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1557541', 'n_tokens_mistral': 851, 'n_tokens_neox': 794, 'n_words': 182}