Skip to content

Instantly share code, notes, and snippets.

Last active March 19, 2016 21:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Mike Tyson's Punch-Out!! as a Neo4j database
image::[align="center", Punchout!!!]
This is a quick and fun little graph of the classic Nintendo game, Mike Tyson's Punch-Out!!.
The information for the graph comes directly from the[Punchout Wiki]. The graph is based off the NES console from 1987 as opposed to the earlier arcade games or the later release for the Wii, etc.
I took the liberty of having Little Mac win all his fights by knockout. But then he went up against Iron Mike...
_Notice that the dataset is read in painlessly via Google Docs as outlined[here]._
'' AS line
MERGE (b1:boxer {
boxer_id: line.boxer_id,
MERGE (b2:boxer {boxer_id: line.fought
MERGE (f:fight { fight_id: line.fight_id,
notes: line.notes,
outcome: line.outcome
//CREATE (b1)-[:AGAINST]->(b2)
total_fights: line.total_fights,
wins: line.wins,
wins_by_KO: line.wins_by_KO,
losses: line.losses,
weight: line.weight,
height: line.height,
nationality: line.nationality,
age: line.age,
rank: line.rank
} ]->(f);
Query 2: What happened when Little Mac fought opponents ranked #1?
MATCH (result) <-[r:BOXER_STATUS]- (boxer)
WHERE toInt(r.rank) = 1
RETURN result.outcome, result.notes
Query 3: Did Little Mac lose twice to anyone? Or win twice against anyone?
START n=node(*), m=node(*)
n.outcome=m.outcome AND
ID(n) <ID(m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment