united-states intellectual-property
Is it legal to program a published game for educational purposes (and put the source code on GitHub)?
<p>I own a card game that I enjoy playing (not a playing card game using a standard 52-card deck). I enjoy it enough that I thought it'd be fun to write a program (complete with AI!) that plays that game. Is this legal? Furthermore, may I publish the source code to a public website such as GitHub without incurring any legal issues?</p>

<p>Assuming it's illegal for me to do this, at what point does doing this become legal? I likely cannot simply change all the names of the various cards to something else, right? If I start changing the rules of the game, does that make it legal for me to share my source code, for instance? It'd be a game that's heavily inspired by the original, but isn't (different rules, different cards, different amounts even).</p>

<p>If any elements of the game are protected by copyright, then you cannot reproduce those elements (<a href="https://www.law.cornell.edu/uscode/text/17/106">17 U.S.C. §106</a>) unless your reproduction falls under a fair use exception (<a href="https://www.law.cornell.edu/uscode/text/17/107">17 U.S.C. §107</a>).</p>

<p>Elements that <em>may</em> be protected by copyright include:</p>

<ul>
<li>artwork</li>
<li>specific language on each card</li>
<li>the aggregate effects of the cards (i.e. copying a single card's effects might not infringe copyright, but if you copy the effect of a bunch of the cards, such that you are taking expression of the original author's creativity, that might infringe, even if you change the words used)</li>
</ul>

<p>Whether an element of the game is protected by copyright is a fact-intensive question that would depend on the specifics of the game. Whether your copy infringes is likewise a fact-intensive question that would depend on what you copy.</p>

<p>Fair use is also a fact-intensive, case-by-case analysis, but in my opinion, it is likely that creating a computer program derivative work (<a href="https://www.law.cornell.edu/uscode/text/17/101">17 U.S.C. §101</a>) of the game for your own personal education would be considered fair use. From a practical standpoint, even if it were not fair use, it would be near impossible for the copyright owner to discover.</p>

<p>Posting the code on GitHub tips the scales away from fair use because of (<a href="https://www.law.cornell.edu/uscode/text/17/107">17 U.S.C. §107(4)</a>): "<em>the effect of the use upon the potential market for or value of the copyrighted work.</em>" But, none of the factors are determinative on their own.</p>

<p>You ask:</p>

<blockquote>
  <p>I likely cannot simply change all the names of the various cards to something else, right?</p>
</blockquote>

<p>I agree. In my opinion, the selection and arrangement of the effects attributed to each card is an expression of the author's creativity, and no matter what you call the cards, copyright in the <em>game</em> would be implicated if you retained the effects associated with each card.</p>

<blockquote>
  <p>If I start changing the rules of the game, does that make it legal for me to share my source code, for instance?</p>
</blockquote>

<p>At some point, it will be an entirely different game, so certainly, in the limit, your work would not be infringing. We can't answer where that line is, but in general, the less of the original author's creativity that you re-use, the less likely a ruling of infringement. Also, in general, the more transformative your work is, the more likely a fair use exception would apply.</p>
