<commit_before>---
layout: post
title:  Math Battle II
image_path: /images/projects/math-battle/banner.png
tagline: An experiment in online real-time multiplayer, brand design, and how much people secretly like math
card_color: "#E461FF"
awards:
  - "10Under20 Recipient"
  - "Winner of 2015 Congressional App Challenge"
  - "\"Best UI Design\" at Local Hack Day 2015"
ending:
  tagline: Math Battle was released in August 2016.
  link: http://mathbattle.pw
  link_text: visit site
skills: swift objective-c python sass photoshop git sketch firebase
---

Nowadays, getting children (and adults!) to play “educational games” can be hard to nearly impossible. That’s where Math Battle comes in. Originally created at Local Hack Day 2015 @ General Assembly and winner of the 2015 Congressional App Challenge, Math Battle is an iOS game where two players play on the same screen and go head-to-head in a battle of intellect attempting to solve procedurally generating, math-based puzzles faster than the other player.

{% include youtube_player.html width=640 id="OmnT4P_ALu4" %}

### Overview

Users can either play Math Battle locally on the same phone using a split-screen form of the game or compete in “ranked battles” via an online multiplayer mode. Battles consist of players competing to solve five procedurally generated puzzles faster than the other player. To do so, they are given a random set of nine “number tiles” and a target number.

Players must use *all* nine number tiles in order to come up with a math equation that, when evaluated, results in the target number. A player wins the battle when they have solved five puzzles faster than the other player or, after two minutes, the player with the highest number of solved puzzles wins.

### Implementation

I programmed the majority of the app in Swift using the open-source game engine [cocos2d-objc][cocos2d-github], and designed and created all of the artwork myself using a combination of Adobe Illustrator and Sketch.

All puzzles are generated on the fly, each with a guaranteed solution. This allows for massive replayability, so you can challenge your enemies (and your math teachers, of course) to a Math Battle as many times as you want and still get new puzzles every time.

<div class="four-screenshot-grid lazyload" data-expand="-20">
    <img class="lazyload" data-src="/images/projects/math-battle/custom-match.png">
    <img class="lazyload" data-src="/images/projects/math-battle/practice-match.png"><commit_msg>Update 2016-06-12-math-battle.markdown<commit_after>---
layout: post
title:  Math Battle II
image_path: /images/projects/math-battle/banner.png
tagline: An experiment in online real-time multiplayer, brand design, and how much people secretly like math
card_color: "#E461FF"
awards:
  - "10Under20 Recipient"
  - "Winner of 2015 Congressional App Challenge"
  - "\"Best UI Design\" at Local Hack Day 2015"
ending:
  tagline: Math Battle was released in July 2016.
  link: http://mathbattle.pw
  link_text: visit site
skills: swift objective-c python sass photoshop git sketch firebase
---

Nowadays, getting children (and adults!) to play “educational games” can be hard to nearly impossible. That’s where Math Battle comes in. Originally created at Local Hack Day 2015 @ General Assembly and winner of the 2015 Congressional App Challenge, Math Battle is an iOS game where two players play on the same screen and go head-to-head in a battle of intellect attempting to solve procedurally generating, math-based puzzles faster than the other player.

{% include youtube_player.html width=640 id="OmnT4P_ALu4" %}

### Overview

Users can either play Math Battle locally on the same phone using a split-screen form of the game or compete in “ranked battles” via an online multiplayer mode. Battles consist of players competing to solve five procedurally generated puzzles faster than the other player. To do so, they are given a random set of nine “number tiles” and a target number.

Players must use *all* nine number tiles in order to come up with a math equation that, when evaluated, results in the target number. A player wins the battle when they have solved five puzzles faster than the other player or, after two minutes, the player with the highest number of solved puzzles wins.

### Implementation

I programmed the majority of the app in Swift using the open-source game engine [cocos2d-objc][cocos2d-github], and designed and created all of the artwork myself using a combination of Adobe Illustrator and Sketch.

All puzzles are generated on the fly, each with a guaranteed solution. This allows for massive replayability, so you can challenge your enemies (and your math teachers, of course) to a Math Battle as many times as you want and still get new puzzles every time.

<div class="four-screenshot-grid lazyload" data-expand="-20">
    <img class="lazyload" data-src="/images/projects/math-battle/custom-match.png">
    <img class="lazyload" data-src="/images/projects/math-battle/practice-match.png">
{'fraction_non_alphanumeric': 0.0644324755635348, 'fraction_numerical': 0.015958507879513265, 'mean_word_length': 4.552602436323366, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4029502', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1271, 'n_words': 696}