cocopilot跟gpt4哪一个写代码比较强

cocopilot跟gpt4哪一个写代码比较强

1 个赞

cocopilot强些,他有专门优化过

现在哪还有cocopilot

专业的事交给专业的团队

确实,专业的人干专业的事

github的copilot写代码能直接运行,但是对给出意思了解不怎么准确。google能够准确理解意思,但是给出的代码有问题得一遍又一遍的改。
我给出要求:用python写一个能动态交互的心形图案
Copilot的代码:

import turtle

def draw_heart(turtle, color='red', size=100):
    turtle.speed(1)
    turtle.shape('turtle')
    turtle.color(color)
    turtle.begin_fill()

    turtle.left(140)
    turtle.forward(size)
    turtle.circle(-size/2, 200)
    turtle.left(120)
    turtle.circle(-size/2, 200)
    turtle.forward(size)

    turtle.end_fill()
    turtle.done()

draw_heart(turtle.Turtle())

然后是Google Gemini 1.5 Pro给出的代码

import matplotlib
# 指定交互式框架,例如 Qt5
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation

# 心形函数
def heart_function(t):
    x = 16 * (np.sin(t) ** 3)
    y = 13 * np.cos(t) - 5 * np.cos(2 * t) - 2 * np.cos(3 * t) - np.cos(4 * t)
    return x, y

# 创建画布和坐标轴
fig, ax = plt.subplots()

# 设置坐标轴范围
ax.set_xlim([-20, 20])
ax.set_ylim([-20, 20])

# 初始化心形线
line, = ax.plot([], [], color='red', linewidth=2)

# 更新函数,实现动态效果
def update(frame):
    x, y = heart_function(frame)
    # 将 NumPy 数组转换为列表
    line.set_data(list(x), list(y))
    return line,

# 创建动画
animation = FuncAnimation(fig, update, frames=np.linspace(0, 2 * np.pi, 200), interval=50, blit=True)

# 显示动画
plt.show()
2 个赞

coco吧

你自己更强

copilot吧…

cocopilot还是copilot,还是GitHub copilot?

+2

GitHub copilot 不好意思 写错了