提示詞:
創建一個可愛的粉紅色十字繡杯子蛋糕,蛋糕上面有不同色彩鮮豔造型獨特的十字繡多肉植物,底部是黃色的十字繡紙杯。
十字繡是從布的背面穿針引線,在正面開始繡「X」,先斜向繡一針,再反方向繡一針,形成「X」。
工具:Bing
運用Grok輸入:
將下列的提示詞轉成程式碼:
創建一個可愛的粉紅色十字繡杯子蛋糕,蛋糕上面有不同色彩鮮豔造型獨特的十字繡多肉植物,底部是黃色的十字繡紙杯。 十字繡是從布的背面穿針引線,在正面開始繡「X」,先斜向繡一針,再反方向繡一針,形成「X」。
Grok的回應會根據如何使用Python腳本的結構,使用Pillow來概念化這個創意項目的描述。繪製十字繡杯子蛋糕的圖像。
from PIL import Image, ImageDraw
# 創建一個新的圖像
width, height = 300, 400
image = Image.new('RGB', (width, height), color='white')
draw = ImageDraw.Draw(image)
# 繪製粉紅色杯子蛋糕
def draw_cupcake(x, y, width, height, color):
# 蛋糕部分
draw.rectangle([x, y, x + width, y + height], fill=color)
# 紙杯部分
draw.rectangle([x - 10, y + height, x + width + 10, y + height + 30], fill='yellow')
# 繪製十字繡效果
def draw_cross_stitch(x, y, size, color):
# 繪製"X"形
draw.line([x, y, x + size, y + size], fill=color, width=2)
draw.line([x + size, y, x, y + size], fill=color, width=2)
# 杯子蛋糕
draw_cupcake(50, 50, 200, 200, 'pink')
# 多肉植物
plants = [
{'pos': (100, 100), 'color': 'green', 'size': 20},
{'pos': (150, 120), 'color': 'red', 'size': 25},
{'pos': (200, 150), 'color': 'blue', 'size': 30}
]
for plant in plants:
draw_cross_stitch(*plant['pos'], plant['size'], plant['color'])
# 保存圖像
image.save('cross_stitch_cupcake.png')