Global searching is not enabled.
Skip to main content

Blog entry by bhumika dhingra

Truth n Dare Game with Coding in Python

*All important links are attached in the end.

Creating your own TRUTH AND DARE GAME on Funoppia’s FunAI Platform

Steps to Follow:

1. Visit Funoppia’s FunAI IDE from the Funoppia website & then Create a list of Truths by following the steps on the Platform.

a. Open List category present inside Data Structures category and get the first block out.





b. Open text category & get the first block out. Then attach it with list block.




c. Create a variable with name truths and attach its first block — set truths to — with the list block.




d. Now write some truth questions in the text boxes that you added.




2. Similarly, create a list of dares as well.




3. Now ask for the user’s choice.
a. Open the Input/Output category & get the Take Input Text block out.




b. Now, create a new variable with name choice & attach the set choice to block with the take input block.




4. Drag out the if-do block from the Logic category and the 2nd block also from the same category. Connect them as shown.




5. In the first blank, attach the variable with name choice and in the 2nd blank, attach the text block with truth written inside it as shown.




6. Now get the print block out from the input output category & attach it with the — in list list get #— block present in the list category.




7. First, Put this print block inside the do part of the if block. Now, click on list & a dropdown will appear. From that dropdown choose truths
list. After that click on the # in the same block & choose random option from the dropdown.





8. Now, click on the settings button present in the if-do block. Drag the else-if block and attach it under the if block inside the popup only (as shown)




9. Click on the settings button again, to close the popup & then complete your code as shown.




10. The last step! To check if any other wrong choice is entered by the user, again open the settings popup of if block & now drag the else block towards the right side & attach it
under the else-if block. Then add a print statement inside the do part of the else statement.






And you are done!!!! Press the Run Button

& try playing the game!


Important Links

• Funoppia Website — www.funoppia.com
• Funoppia IDE —www.funoppia.com/funide
• Blind Bird Game — funzone.funoppia.com/bird.html
• Funzone Games — funzone.funoppia.com
• Projects Playground — projects.funoppia.com
• Truth n Dare Game — projects.funoppia.com/truthanddare/
• Truth n Dare Game Code — https://www.funoppia.com/funide/#ikchzhg






Final Python code generated in the editor window:


 
import random


truths = ["What's your favorite fruit?", 'Who is your best friend?', 'What is your nickname?', 'Now, Can you create your own truth n dare game?']
dares = ['Drink a glass of water', 'Keep quiet for 5 mins', 'Create your own truth n dare game!']
choice = str(input())

if choice == 'truth':
print(random.choice(truths))
elif choice == 'dare':
print(random.choice(dares))
else:
print('Wrong choice!')

  • Share

Reviews

Show comments
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:14 PM
    Cool stuff you have and you keep overhaul every one of us Paramount Plus Free Trial
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:16 PM
    Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have. Project Management Software
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:24 PM
    wow... what a great blog, this writter who wrote this article it's realy a great blogger, this article so inspiring me to be a better person ClickUp Alternatives
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:30 PM
    The writer is enthusiastic about purchasing wooden furniture on the web and his exploration about best wooden furniture has brought about the arrangement of this article. GeneratePress Review
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:32 PM
    I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts. Pressable
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:34 PM
    I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. Liquid Web Review
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:42 PM
    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Cloudzat
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:43 PM
    I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read !! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. Best Web Hosting For Small Business
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:45 PM
    Excellent effort to make this blog more wonderful and attractive. Peacock
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:47 PM
    I would recommend my profile is important to me, I invite you to discuss this topic... Exipure Review
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:48 PM
    You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog. Peacock Premium Free Trial
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:50 PM
    Always so interesting to visit your site.What a great info, thank you for sharing. this will help me so much in my learning Doodly
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:52 PM
    They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. Jump Street
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:54 PM
    The writer is enthusiastic about purchasing wooden furniture on the web and his exploration about best wooden furniture has brought about the arrangement of this article. Hulu Free Trial
  • Picture of jamesonrobert jamesonrobertjamesonrobert jamesonrobert - Thu, 21 Apr 2022, 4:55 PM
    I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. Netflix Free Trial
1 2