Baseball is a bat-and-ball game played between two teams of nine players. The objective is for the offensive team to score runs by hitting the ball into play and running around four bases, while the defensive team tries to prevent runs by getting batters or runners out. Alexander Joy Cartwright is credited with inventing the modern game of baseball in 1845 by establishing its basic rules and regulations with the New York Knickerbocker Club. A regulation baseball game is divided into innings with the visiting team batting first in the top half and the home team batting second in the bottom half. The various positions in baseball each have distinct responsibilities related to batting, fielding, throwing, and other fundamental skills.