案例:Claude 2生成的生命游戏代码     状态:可编辑再运行    进入横版
x
  alive ? cell.classList.add('alive') : cell.classList.remove('alive');
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <title>Game of Life</title>
5
  <style>
6
    #grid {
7
      display: flex;
8
      flex-wrap: wrap;
9
      width: 200px;
10
      height: 200px;
11
    }
12
    .cell {
13
      width: 10px;
14
      height: 10px;
15
      border: 1px solid black;
16
    }
17
    .alive {
18
      background-color: pink;
19
    }
20
  </style>
21
</head>
22
<body>
23
  <div id="grid"></div>
24

 运行结果 
 北美留学生论坛