- "Here's the algorithm. You're looking for a program using this sequence."
- ―Captain Rex, to Tech
Rex's battle strategy algorithm was an algorithm that belonged to Clone Captain Rex of the 501st Legion in the Grand Army of the Republic, which he had created to analyze Republic Military strategies for weaknesses and come up with ways to counter them. ARC troopers Fives and Echo were the only other people who knew the algorithm. However, during the Battle of Anaxes, the Separatist Droid Army was somehow pushing back the Republic forces on all fronts, and Rex theorized that the Separatists had somehow gained access to the algorithm, despite Echo and Fives both being presumed dead and that he was the only person who should have known of its existence. Infiltrating the Separatist Cyber Center on Anaxes, Rex and Clone Force 99 member Tech discovered that the algorithm was actually being broadcast live from Skako Minor by a still-alive Echo, who was in the custody of the Separatist-aligned Techno Union. Separatist Admiral Trench had been using the algorithm to gain an advantage over the Republic's forces during the battle.
The algorithm was invented by Clone Captain CT-7567 "Rex" of the 501st Legion, who was one of the most talented officers the Republic Military had during the Clone Wars, to analyze Galactic Republic strategies and develop counters to any discovered weaknesses. ARC troopers CT-5555 "Fives" and CT-1409 "Echo" were the only ones besides Rex who knew the algorithm.
Rex developed the algorithm, with only Fives and Echo also aware of its existence, some time before the Battle of Lola Sayu. With Echo's apparent death in an explosion during the action on Lola Sayu and Fives' later death on Coruscant after having allegedly gone insane, Rex was seemingly the only person alive who knew of the algorithm's existence. However, Echo had not actually died at the Citadel. Severely injured in the explosion of the Sheathipede-class Type B shuttle he had been attempting to reclaim, he was salvaged by the Separatists, eventually winding up in the hands of the Techno Union. He was turned into a cyborg, and the Union extracted information from his brain, allowing them to use him to work out the algorithm. Kept in stasis in a facility in Purkoll on Skako Minor, he was unaware of his surroundings or what was happening to him.
When the campaign for control of the planet Anaxes began, Admiral Trench, in command of the Separatist forces, had the algorithm transmitted from Skako Minor to a Cyber Center constructed on Anaxes' surface, where he could review it from his flagship. Over the course of several weeks, the Republic's hold on the planet began to slip away, with their forces sustaining unusual losses. Captain Rex believed that the Separatists were somehow using his strategies and algorithm, and came to the conclusion that Echo was the only possible way the enemy could have gotten a hold of them, meaning that he might still be alive. He and Clone Commander Cody came forward to Jedi Generals Mace Windu and Anakin Skywalker with the theory that the Separatists had somehow figured out how to counter Rex, but the Captain was loath to admit his idea that Echo was still alive as he thought the Jedi might think he was crazy for suggesting it. Rex and Cody received permission to lead a strike team behind enemy lines to the Cyber Center to find out how they were being countered.
Cody called in Clone Force 99, an irregular unit of clone commandos informally known as the "Bad Batch," to participate in the mission alongside himself, Rex, ARC trooper CT-5597 "Jesse," and clone medic CT-6116 "Kix." When let in on the theory that Echo was still alive, Cody was skeptical. En route, the gunship the strike team was travelling was shot down, leaving Cody severely injured and Rex in charge of the mission, as Kix stayed behind with Cody to wait for an evac. Upon breaching the Cyber Center in a two-pronged attack, Tech of the Bad Batch accessed the center's computers and found that the algorithm was a live transmission instead of a stored program. Digging deeper, Tech found a transmission of Echo's voice, and when Rex asked for the voice's identity, the response was Echo's identification number, CT-1409, proving he was alive.
The discovery led Rex, Skywalker and the Bad Batch to launch an unsanctioned mission to Skako Minor to rescue Echo from the Techno Union. Despite heavy resistance from battle droids, and Trench having warned Wat Tambor that the infiltration was likely, the strike team was able to get to Echo and release him from the stasis chamber. After Tambor's battle droids failed to recapture Echo, Tambor decided to hold off on informing the Separatist military of the loss as he wanted to find a way to recoup the lost profits that the ARC trooper's escape represented.
Behind the scenes
- "As you know, I've studied our battle lines for some time. I developed an algorithm to counter all our tactical tendencies, with the hope we could use it to shore up our weaknesses. Since this battle for Anaxes started, the Separatists have always been one step ahead of us. If I'm right, Admiral Trench has my algorithm, and he's using it to predict our strategies. It's just… I don't know how he got it. My data files are heavily encrypted."
- ―Rex, in the original version of "The Bad Batch"
- Star Wars: The Clone Wars – "The Bad Batch" (First appearance)
- Star Wars: The Clone Wars – "A Distant Echo" (In flashback(s))
- Star Wars: The Clone Wars – "Unfinished Business" (In flashback(s))
- Star Wars Helmet Collection 16 (Databank A-Z: E-11 Blaster–Cornelius Evazan)
- Ultimate Star Wars, New Edition (First identified as Rex's battle strategy algorithm)