body: 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?
  
  
  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).
  
  
  
title: Is it legal to program a published game for educational purposes (and put the source code on GitHub)?