r/coding • u/StephanoCarlson • Jan 25 '21
I made a program that shows how effective gerrymandering can be in python - source code & explanation in description
https://www.youtube.com/watch?v=d8M1bCLl-i0&feature=youtu.be6
u/jms_nh Jan 25 '21
I kept waiting for someone to come out with a game involving politics / gerrymandering / ratfcking / misinformation etc. given the last four years. At least let's have some fun with the situation instead of repressed anger.
3
u/toxicwaste55 Jan 26 '21
I've dreamed of making one for many years. The hard part is making it fun enough that you could make a living off it. The harsh reality of game dev is that your dream project is almost certainly doomed. There's no way I can justify losing my insurance, falling behind on my mortgage, and not funding my retirement to make an app that you play for 10 minutes and uninstall.
1
u/ArkyBeagle Jan 26 '21
instead of repressed anger.
Nah. Just look at it for what it is. Really, life gets better if you give humanity the benefit of the doubt. People really do the best they can but it only goes so far.
1
Feb 03 '21
This is beautiful. How did you map the connected edges? You should blog about this.
1
u/StephanoCarlson Feb 03 '21
Thanks. For the edges - every district has a list of people contained. Each person has their own line “ids”, which are used to turn on or off the lines. With all of them on it would appear as a simple grid. When drawing the district, I collect all the line ids of all the people contained into a list. The line ids that make up the edges of the district will only appear once in that list, and all the ones that appear 2+ times are in the middle of the district. Hope that made sense
3
24
u/purleyboy Jan 25 '21
Do not give this code to the GOP
14
3
u/flip314 Jan 25 '21
They have this code already (used in conjunction with very detailed voter information). It's what made REDMAP possible in 2010.
1
4
u/oantolin Jan 25 '21
I would have worded the title as follows: "I made a program in python that shows how effective gerrymandering can be". :)
2
3
1
1
u/toobulkeh Jan 25 '21
-80 to +80 swing for both sides? Well done.
This shit needs to be taken more seriously, there's too much money in it for people NOT to spend boatloads on it.
1
1
-30
u/omega552003 Jan 25 '21
Do not give this code to the DNC
5
u/cbarrick Jan 25 '21
TBF, we're in the midst of the 2020 redistricting cycle, and the GOP is largely in charge.
States decide how they redistrict.
19 states will be redistricted by a GOP controlled legislature.
8 states will be redistricted by a DNC controlled legislature.
16 states will either split the redistricting power or use independent commissions.
7 states have only one district.
The power of the GOP is put into perspective when you look at the number of districts they will be in charge of drawing:
The GOP will draw 182 districts.
The DNC will draw 76 districts.
https://en.wikipedia.org/wiki/2020_United_States_redistricting_cycle
Also, the GOP was in charge of the 2000 and 2010 redistricting cycles that got us into this gerrymandered mess in the first place.
Gerrymandering is explicitly part of the GOP policy. They call it project REDMAP.
17
Jan 25 '21
You are confused about which party does the bulk of gerrymandering in 2021. If we were in the 90s, I might agree with you.
4
u/Mechakoopa Jan 25 '21
How about we just agree "fuck gerrymandering" in general and give this to nobody?
14
u/RedditingJinxx Jan 25 '21
Very impressive, well done