<s>Human: 编写代码生成一个简单的“石头，剪子，布”游戏。
</s><s>Assistant: 以下是一个Python版本的“石头，剪子，布”游戏代码示例：

```python
import random

def game(player_choice):
    computer_choice = random.choice(['rock', 'paper', 'scissors'])
    print(f"Player chose {player_choice}, computer chose {computer_choice}.")

    if player_choice == computer_choice:
        return "It's a tie!"
    elif (player_choice == 'rock' and computer_choice == 'scissors') or \
         (player_choice == 'paper' and computer_choice == 'rock') or \
         (player_choice == 'scissors' and computer_choice == 'paper'):
        return "Player wins!"
    else:
        return "Computer wins!"

player_choice = input("Enter your choice (rock/paper/scissors): ")
result = game(player_choice)

print(result)
```

该代码首先导入了`random`库以实现计算机随机选择，然后定义了一个`game`函数来进行游戏的比较和输出。该函数接受玩家选择的参数，在函数内部生成计算机的选择并进行比较，返回胜利方。

随后，代码从用户输入中获取玩家选择，然后通过`game`函数获取结果并输出。
</s>