Not only were there magazines dedicated to code, kids, there were ENTIRE BOOKS containing listings of game programs, usually in BASIC. While this forced everyone to type in the game for him/herself, pretty much every home computer in the 1980s ran BASIC, so the games, if they didn't use computer-specific code, could be ported (and modified to one's content) to pretty much any random home computer brand.
Here's an example: the first in the BASIC Computer Games series put out by Creative Computing. If the name David H. Ahl means anything to you, then you most likely have a well-worn copy of this book stashed somewhere in your basement. http://atariarchives.org/basicgames/