Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    very basic space related quiz

    Creation share codes
    3
    7
    303
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      smithpa01 last edited by

      As a complete beginner in coding i have started small this is the first thing i have ever made, a very basic 5 question space quiz based on the if then statement tutorial, no scoring system yet as i didn't want to confuse myself and make it too complex for me at my current level
      ID: UXK732ETTL

      1 Reply Last reply Reply Quote 10
      • Dave
        Dave Fuze Team last edited by

        Congratulations on your first project and for posting it here. Nice one! You should be super proud :)

        Love the space thing so I was happy to have a go. Unfortunately I missed out the "the" in "The Milky Way" :D

        Looking forward to seeing how you improve this. Let me know if you want any help or have any questions.

        S 1 Reply Last reply Reply Quote 0
        • S
          smithpa01 @Dave last edited by

          @Dave thanks for the encouragement, in the future i will probably expand on the questions, add more alternative answers (like just milky way) and possibly add pictures to the quiz to flesh it out

          1 Reply Last reply Reply Quote 1
          • Dave
            Dave Fuze Team last edited by

            When creating a fleshed-out quiz it will be very satisfying to make it using a couple of slightly more advanced techniques. Have you looked at for loops, arrays and functions at all yet?

            1 Reply Last reply Reply Quote 0
            • Dave
              Dave Fuze Team last edited by

              Here's a quick tip I will let you in on regardless, since it will save you a lot of time!

              You know how currently when you want to print a question you have to do the following:

              print("the question")
              update()
              sleep(1) // or whatever your sleep number is
              

              Because you need update() and sleep() every time you want to print a message with a delay, you'll end up repeating these lines a lot. You can set up your own, simple, custom function to do this whenever you like with just one line. Like this:

              function quizPrint( text, delay )
                  print( text )
                  update()
                  sleep( delay )
              return void // Don't worry about this weird looking line. It just means the functions ends here and returns no values.
              

              Then, in your code, whenever you want to print with a delay afterwards, you would use your new function, just like you would with print(). Like this:

              quizPrint( "1. What is the 5th planet in the solar system?", 1 ) // Notice the 1 - this will be sent to the function as the 'delay' variable and used in the sleep() command.
              

              Fuze would then take the question and the number 1 and pass them to our new quizPrint() function as the text and delay variables we used in it.

              This of course can go as far as you like, you could add to our quizPrint function so it also takes a colour to print in as well:

              function quizPrint( text, colour, delay )
                  ink( colour )
                  print( text )
                  sleep( delay )
              return void
              

              Then you might write: quizPrint( "1. What is the 5th planet from the solar system?", blue, 1 ) and we'd get the question in blue :)

              Of course, apologies if this is too much too soon! I strongly suggest giving it a try though, it will save you some time and teach something important!

              S 1 Reply Last reply Reply Quote 1
              • SteveZX81
                SteveZX81 F last edited by

                Well done! getting your first project out is a great feeling. as a huge space fan I can't wait to give your quiz a go later tonight!

                1 Reply Last reply Reply Quote 2
                • S
                  smithpa01 @Dave last edited by

                  @Dave thanks for the tips i will have to go over them fully later when i my brain switches back on it has had enough for today

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post