While optimizing scheduling problems such as the traveling salesman problem has been common practice in neural networks, solving planning problems such as the Tower-of-Hanoi (TOH) has been difficult in neural networks. The differences between the scheduling and planning problems are identified here from the neural network perspective, based on which an approach to solve planning problems with learning is proposed. In particular, the TOH is chosen as the target problem and represented as an array of neurons. A set of constraints derived from the TOH is formulated based on this representation. The system is designed to learn to generate legal moves. Learning legal moves is accomplished by generating illegal states and by measuring the legality of the states. Simulation results show that the system moves in a direction in which it learns legal moves for the TOH.