import random
import string
# 生成一个随机的字母串
def generate_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for _ in range(length))
return result_str
# 生成一个随机的整数
def generate_random_number(start, end):
return random.randint(start, end)
# 生成随机的Idea提示
def generate_idea_prompt():
prompts = [
"Write a story about a group of friends who discover a hidden treasure.",
"Imagine a world where technology no longer exists. Write a day in the life of someone in this world.",
"Create a character who can speak to animals. Write a dialogue between this character and their favorite animal.",
"Write a poem inspired by the colors of the sunset.",
"Imagine you are stranded on a deserted island. Write a letter to a loved one describing your everyday life and your hopes for the future.",
"Create a recipe for a magical dish that has the power to grant wishes.",
"Write a short play about two strangers who meet at a bus stop.",
"Imagine you wake up with the ability to fly. Write about your first flight experience.",
"Write a persuasive essay on why people should prioritize mental health.",
"Imagine you are a detective solving a mysterious crime. Write a scene where you uncover a major clue.",
"Create a superhero with a unique superpower. Write a comic strip showcasing their adventures.",
"Write a letter to your future self, giving advice and reflecting on your goals and aspirations.",
"Imagine a world where everyone can read minds. Write a dialogue between two friends who discover this new power.",
"Write a short story set in a post-apocalyptic world, focusing on the survival and resilience of humanity.",
"Create a board game with a unique concept and rules. Write a brief description of how to play.",
"Imagine a world without social media. Write a speech discussing the pros and cons of this scenario.",
]
return random.choice(prompts)
# 生成1000字的Idea提示代码补全
def generate_1000_word_idea_prompt():
word_count = 0
result = ""
while word_count < 1000:
prompt = generate_idea_prompt()
prompt_length = len(prompt.split())
if word_count + prompt_length <= 1000:
result += prompt + " "
word_count += prompt_length
else:
remaining_words = 1000 - word_count
prompt_words = prompt.split()[:remaining_words]
prompt = " ".join(prompt_words)
result += prompt
return result
# 测试
print(generate_1000_word_idea_prompt())
声明:免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:dm@cn86.cn进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。本站原创内容未经允许不得转载。