I read this when I was very young after watching the 70's movie of the same name. I'm pretty sure this was written for the movie or from the movie (A bit hard to tell). My memory of weather I liked it or not is a bit blurry although the concepts were relevant at the time.
Plot ***Spoilers***
Sometime in the near future a high-tech, highly realistic adult amusement park called Delos features androids that are almost indistinguishable from human beings. For $1,000 per day, guests may indulge in any fantasy, including killing or having sex with the androids. Delos' tagline in its advertising promises "Have we got a vacation for you!" The androids are programmed to act in character for each of the park's three themed "worlds" — WestWorld (the American Old West), MedievalWorld (medieval Europe), and RomanWorld (pre-Christian Rome). One of the attractions in WestWorld is the Gunslinger, a robot programmed to start duels. Thanks to its programming, humans can always outdraw the Gunslinger and kill it. The guns issued to the guests also have temperature sensors that prevent them from shooting each other or anything else living, but allow them to "kill" the room-temperature androids.
Peter Martin, a first-timer, and his friend John Blane, who has visited previously, visit WestWorld. Gradually, the technicians running Delos begin to notice problems spreading like an infection among the androids: the robots in MedievalWorld begin suffering an inexplicable number of systemic failures, a robot rattlesnake bites Blane, and against its programming, an android refuses a guest's sexual advances. The failures increase until the robotic Black Knight kills a guest in a sword fight in MedievalWorld. The resort's supervisors, in increasing desperation, try to regain control by shutting down power to the entire park, but this traps them in the control rooms, unable to turn the power back on while the robots run amok on stored power.
Martin and Blane, passed out drunk after a bar-room brawl, wake up in the WestWorld bordello, unaware of the breakdown. When the Gunslinger challenges the two men to a showdown, Blane treats the confrontation as a typical amusement until the robot shoots and kills him. Martin runs for his life as the robot implacably follows him.
Martin flees to the other areas of the park, but finds only a panicky fleeing technician, dead guests and damaged robots. He climbs down through a manhole to the underground control area, where the resort's technicians have suffocated since the ventilation shut down. As the Gunslinger stalks Martin through the corridors, he throws acid into its face and sets fire to it with a torch. He also finds a woman chained up in the dungeon, but she turns out to be an android. Finally, the burned hulk of the Gunslinger attacks him one last time before succumbing to its damage.