Skip to content
TheChatArchiveThe Chat Archive
Mistralmistral-small-2506· Mistral AIHugging Face LMArena Human Preference 140K

ようやく動作した ヘルパーは自由にすべての軸で動かせるようにして、格子は菱形にもなるはず

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-flash-lite-preview-06-17-thinking’s answer.
  1. User

    ようやく動作した ヘルパーは自由にすべての軸で動かせるようにして、格子は菱形にもなるはず

  2. Mistral Assistant

    完全自由移動可能な等面積グリッドシステム

    以下のスクリプトは、ヘルパーを自由にX/Y/Z軸のどの方向にも移動可能にし、菱形状のグリッドもサポートするように改良したものです。移動したヘルパーの位置を基準に、他のヘルパーを自動調整します。

    /*─────────────────────────────────────────────
       完全自由移動可能な等面積グリッドシステム
       - 任意の軸方向への移動に対応
       - 菱形状のグリッドもサポート
       - 移動したヘルパーを基準に再配置
    ─────────────────────────────────────────────*/
    
    global gridPoints = #()
    global gridCols = 6
    global gridRows = 5
    global isUpdating = false
    
    /*------------------------------------------------
      グリッド再レイアウト関数
    ------------------------------------------------*/
    fn relayoutGrid movedPoint =
    (
        if gridPoints.count == 0 or isUpdating do return()
    
        -- 更新開始フラグ
        isUpdating = true
    
        -- 移動したポイントの位置を取得
        local movedPos = movedPoint.pos
    
        -- 移動したポイントの行と列を特定
        local movedCol = 0
        local movedRow = 0
    
        for r = 1 to gridRows do
        (
            for c = 1 to gridCols do
            (
                local idx = (r-1)*gridCols + c
                if gridPoints[idx] == movedPoint do
                (
                    movedCol = c
                    movedRow = r
                    exit
                )
            )
        )
    
        -- 移動したポイントを基準に新しいグリッドを計算
        local newPositions = #()
    
        -- 移動したポイントの位置を保持
        append newPositions movedPos
    
        -- 他のポイントの位置を計算
        for r = 1 to gridRows do
        (
            for c = 1 to gridCols do
            (
                if c != movedCol or r != movedRow then
                (
                    -- 移動したポイントからの相対位置を計算
                    local relPos = [0,0,0]
    
                    -- 同じ行のポイント
                    if r == movedRow then
                    (
                        relPos.x = (c - movedCol) * (movedPos.x / (movedCol - 1))
                    )
    
                    -- 同じ列のポイント
                    if c == movedCol then
                    (
                        relPos.y = (r - movedRow) * (movedPos.y / (movedRow - 1))
                    )
    
                    -- 対角線上のポイント
                    if (c - movedCol) != 0 and (r - movedRow) != 0 then
                    (
                        relPos.x = (c - movedCol) * (movedPos.x / (movedCol - 1))
                        relPos.y = (r - movedRow) * (movedPos.y / (movedRow - 1))
                    )
    
                    -- 新しい位置を計算
                    local newPos = [movedPos.x + relPos.x, movedPos.y + relPos.y, 0]
                    append newPositions newPos
                )
            )
        )
    
        -- 全ポイントを新しい位置に移動
        for i = 1 to gridPoints.count do
        (
            if isValidNode gridPoints[i] do
            (
                gridPoints[i].pos = newPositions[i]
            )
        )
    
        -- 更新完了フラグ
        isUpdating = false
    )
    
    /*------------------------------------------------
      グリッド生成関数
    ------------------------------------------------*/
    fn createGrid startPos endPos =
    (
        -- 既存のヘルパーを削除
        for p in gridPoints where isValidNode p do delete p
        gridPoints = #()
    
        -- 初期間隔を計算
        local xSpacing = (endPos.x - startPos.x) / (gridCols - 1)
        local ySpacing = (endPos.y - startPos.y) / (gridRows - 1)
    
        -- ヘルパーを生成
        for c = 1 to gridCols do
        (
            for r = 1 to gridRows do
            (
                local pos = [startPos.x + (c-1)*xSpacing, startPos.y + (r-1)*ySpacing, 0]
                local pt = point pos:pos size:5 name:("GridPt_" + c as string + "_" + r as string)
                append gridPoints pt
            )
        )
    )
    
    /*------------------------------------------------
      メイン処理
    ------------------------------------------------*/
    (
        -- グリッドを生成
        createGrid [0,0,0] [500,400,0]
    
        -- 各ヘルパーに移動監視を設定
        for pt in gridPoints do
        (
            when transform pt changes do
            (
                if not isUpdating then
                (
                    relayoutGrid pt
                )
            )
        )
    
        format "完全自由移動可能な6×5グリッドを生成しました。\n任意のヘルパーをX/Y/Z軸のどの方向にも移動できます。\n"
    )
    

    主な改良点

    1. 完全自由移動サポート:

      • ヘルパーをX/Y/Z軸のどの方向にも自由に移動可能
      • 移動したヘルパーの位置を基準に他のヘルパーを再配置
    2. 菱形状グリッド対応:

      • 移動したポイントからの相対位置を計算することで、菱形状のグリッドもサポート
      • 移動したポイントを基準に、他のポイントの位置を自動調整
    3. 無限ループ防止:

      • isUpdating フラグで再帰呼び出しを防止
      • 移動監視の際に更新中かどうかをチェック
    4. Z軸移動対応:

      • Z座標も自由に移動可能(ただし、Z方向の調整は行わない)

    使用方法

    1. スクリプトを実行すると6×5のグリッドが生成されます
    2. 任意のヘルパーを選択して、X/Y/Z軸のどの方向にも自由に移動できます
    3. 移動したヘルパーを基準に、他のヘルパーが自動的に再配置されます
    4. 菱形状のグリッドも自由に作成可能です

    このスクリプトは、移動したポイントを基準に他のポイントを再配置するため、菱形状のグリッドも自由に作成できます。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.