开发者代码

促销活动、技术干货、问题解答、技术讨论,学习,成长,分享,共建

idea提示代码补全

2023-11-20 08:46:15 点击:153
idea提示代码补全
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进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。本站原创内容未经允许不得转载。
  • 7x24

    在线售后支持

  • 10

    +

    10年互联网服务经验

  • 300

    +

    全国300余家服务机构

  • 70000

    +

    与70000余家企业客户携手

logo
祥云平台主营业务:品牌型网站建设,高端型网站建设, 外贸型网站建设,营销型网站建设,网站优化, 开发类网站,企业网络营销,搜索引擎推广,微信小程序, 企业邮箱,短视频运营等。

服务热线

400-007-8608

公司:

苏州祥云平台信息技术有限公司
苏州华企立方信息技术有限公司

地址:江苏省昆山市昆太路530号祥和国际大厦15-16层

返回顶部