Python Forum
Rock paper scissors in python with "algorithm"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rock paper scissors in python with "algorithm"
#2
You are thinking about this backward. Why do you have a game history? The computer's next action is based on the results of the current game. The computer AI is one line per result. This program should be about 30 lines long. In Pythonny pseudo code:

computer_play = random play
while True:
    get_human_play
    if human wins:
        next_play = human_play + 1
    else if computer wins:
        next_play = human_play - 1
    else:
        next_play = random play
kabeer_m likes this post
Reply


Messages In This Thread
RE: Rock paper scissors in python with "algorithm" - by deanhystad - Feb-26-2022, 03:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Algorithm for extracting comments from Python source code Pavel1982 6 764 Feb-28-2024, 09:52 PM
Last Post: Pavel1982
  Rock Paper Scissors Project in Python ankitdixit 8 5,037 Feb-23-2024, 03:14 PM
Last Post: DPaul
  Trying to create a visual rock paper scissors game urmom33 1 1,119 Dec-03-2022, 09:12 PM
Last Post: deanhystad
  Problem restricting user input in my rock paper scissors game ashergreen 6 4,762 Mar-25-2021, 03:54 AM
Last Post: deanhystad
  Odd behavior with Rock Paper Scissor game DustinKlent 2 2,031 Aug-27-2020, 03:55 PM
Last Post: DustinKlent
  Trying to implement Best of 3 logic in rock paper scissors game ShAhCh 5 3,495 May-11-2020, 04:31 PM
Last Post: ShAhCh
  Rock Paper Scissors with dictionaries ewgreht 2 3,990 May-01-2020, 03:19 PM
Last Post: deanhystad
  Rock, Paper, Scissors.. Help..hidden bug xxunknownxx 4 2,772 Mar-19-2020, 02:46 AM
Last Post: jefsummers
  POS receipt print cannot make paper cut using python AP_Development 1 2,839 Dec-12-2019, 08:48 AM
Last Post: buran
  Problem with Basic Rock Paper Scissors code BirinderSingh 3 2,579 Sep-13-2019, 03:28 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020