This program simulates a game that involves marbles dropped down a chute labeled A, navigating through a series of gates (X1–X4) that toggle their directions each time they're touched. Gate X1 has three positions (left, center, right) and toggles differently based on whether the marble is represented by a 0 or a 1, while gates X2 through X4 toggle between left and right. The marble follows the direction the gate was set to before it toggles. The program takes as input a string of binary digits (each representing a marble drop) and simulates how each marble moves through the gates, updating gate states accordingly. It outputs the sequence of gate configurations after each drop and determines whether the final marble exits through a winning chute (B or D) or a losing chute (C or E).
forked from emily-mendez/Marble-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
ccandreva/Marble-Game
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C++ 100.0%