pacman-rules

This commit is contained in:
Alexander Heldt committed 2025-10-30 19:47:49 +01:00
1 parent 70cfb196b8
commit 3c64c873ef
10 files changed
+298

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
pub fn eat_ghost(power_pellet_active: Bool, touching_ghost: Bool) -> Bool {
power_pellet_active && touching_ghost
}
pub fn score(touching_power_pellet: Bool, touching_dot: Bool) -> Bool {
touching_power_pellet || touching_dot
}
pub fn lose(power_pellet_active: Bool, touching_ghost: Bool) -> Bool {
!power_pellet_active && touching_ghost
}
pub fn win(
has_eaten_all_dots: Bool,
power_pellet_active: Bool,
touching_ghost: Bool,
) -> Bool {
has_eaten_all_dots && !lose(power_pellet_active, touching_ghost)
}