Arena Battle & Python Study Guide
• Preparation for Online Final Exam (March 14,
2026)
• Visual: Hero battle or coding graphic
Overview of Arena Battle
• A 24-hour coding competition where you code
a hero that fights automatically against other
heroes.
• Objective: Write efficient, smart code for hero
behavior.
• Skills tested: Python programming, algorithms,
decision-making, game logic.
Strings in Python
• Explanation: Strings are sequences of
characters used to store text.
• Operations: Indexing, slicing, concatenation,
formatting.
• Methods: split(), join(), replace(), upper(),
lower()
Lists, Dictionaries, Sets
• Lists: Ordered, mutable sequences.
• Dictionaries: Key-value pairs, mutable.
• Sets: Unordered collections of unique items.
• Example:
• my_list = [1,2,3]
• my_dict = {'HP':100,'MP':50}
• my_set = {1,2,3}
Functions & Recursion
• Functions: Blocks of reusable code with
parameters and return values.
• Recursion: Function calls itself for repetitive
tasks.
• Lambda & map/filter: Short functions and
transforming collections.
• Example:
• def factorial(n):
Arrays & Algorithms
• Prefix sums: Cumulative sums for range
queries.
• Sliding Window: Efficiently solve subarray
problems.
• Two Pointers: Solve problems involving sorted
arrays or pairs.
• Example: Max sum subarray, longest substring
without repeats.
• Practice: Solve LeetCode sliding window &
Searching & Greedy Algorithms
• Linear Search: Iterate through elements to
find a value.
• Binary Search: Efficient search on sorted
arrays.
• Greedy Algorithms: Make locally optimal
choice at each step.
• Example:
• arr = [1,3,5,7,9]
Dynamic Programming (DP)
• Explanation: Break problems into overlapping
subproblems.
• 1D & 2D DP: Linear and grid problems.
• Examples: Fibonacci, 0/1 Knapsack, Longest
Increasing Subsequence (LIS)
• Practice: Solve classic DP problems from
LeetCode or HackerRank.
Arena Battle / GAGA Basics
• Hero movement: Navigate grid to target
efficiently.
• Attack logic: Detect enemies and attack
nearby threats.
• Resource collection: Collect coins or items to
maximize score.
• Decision-making: Prioritize attacking, retreat
when low HP, collect efficiently.
• Practice: Write hero move, attack, and collect
logic in Python.
Arena Battle / GAGA Practice
• Platforms: CodeCombat, CodinGame
• Exercises:
• - Move hero on a grid
• - Attack nearest enemy or retreat if low HP
• - Collect all coins efficiently
• - Simulate 1-vs-1 battles
• Test, refine, and optimize strategies.
Daily Routine
• 45–60 mins Python & algorithm practice
(HackerRank, LeetCode, Codewars)
• 30–45 mins Arena Battle coding (CodeCombat,
CodinGame, simulations)
• Weekend: 1–2 hour mini mock arena
• Weekly review: revisit weak topics and
practice videos.
Tips & Notes
• Keep code modular (move_strategy(),
attack_strategy())
• Test against dummy bots before submission
• Early submission ensures points accumulation
• Iteratively improve code based on battle
outcomes.
Resources & Links
• Video tutorials: Corey Schafer, freeCodeCamp,
NeetCode
• Practice websites: HackerRank, LeetCode,
CodeCombat, CodinGame
• Reference guides for Python and algorithms
• Daily/weekly schedule overview.