three实现三维棋盘调用openai大模型api实现模型对战下中国象棋代码

代码语言:html

所属分类:三维

代码描述:three实现三维棋盘调用openai大模型api实现模型对战下中国象棋代码

代码标签: three 三维 棋盘 调用 openai 大模型 api 模型 对战 中国 象棋 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>AI vs AI 中国象棋 (木质棋子版)</title>
<style>
    body {
        margin: 0;
        font-family: "Microsoft YaHei", sans-serif;
        background: radial-gradient(circle at center, #fdf6e3, #e0c097);
        display: flex;
        height: 100vh;
    }
    #left {
        flex: 1;
        position: relative;
    }
    #right {
        width: 300px;
        background: rgba(255,255,255,0.95);
        overflow-y: auto;
        padding: 10px;
        border-left: 2px solid #ccc;
    }
    #topbar {
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(255,255,255,0.9);
        padding: 8px;
        border-radius: 8px;
        display: flex;
        gap: 8px;
        font-size: 14px;
        align-items: center;
    }
    input, select, button {
        font-size: 14px;
        padding: 4px;
    }
    button {
        cursor: pointer;
    }
</style>
</head>
<body>
<div id="left">
    <div id="topbar">
        Key:<input type="password" id="apiKey" size="18">
        红方:<select id="redModel">
            <option>gpt-4o-mini</option>
            <option>gpt-4o</option>
            <option>gpt-3.5-turbo</option>
        </select>
        黑方:<select id="blackModel">
            <option>gpt-4o-mini</option>
            <option>gpt-4o</option>
            <option>gpt-3.5-turbo</option>
        </select>
        <button id="startBtn">开始对战</button>
        <button id="pauseBtn">暂停</button>
    </div>
</div>
<div id="right">
    <h3>对战日志</h3>
    <div id="log"></div>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/Orb.........完整代码请登录后点击上方下载按钮下载查看

网友评论0