Ready to write some code?
Open your hello_world_device.verse file from Modify and Run Your First Verse Program. You can see a couple of examples of the
Print()function in the file already.Use
Print()to see the effect of combining different operators and literal values. Enter the first line of code below. Work out what will print to the screen before you run the line, then run it to see if you were right.VersePrint("5 + -2 = {5 + -2}") Print("15.0 / 7.0 = {15.0 / 7.0}") Print("I + Love + Verse = {"I" + "Love" + "Verse"}")Repeat this step for the second line (including working out what should print), then again for the third line.
Now copy and paste this line to see what happens!
Print("🐈💗🐟 = {"🐈💗🐟"}")
Complete Script
This is all of the code covered in this exercise. If you get stuck, you can see what the complete script looks like and even copy and paste it into your own Verse file to see the correct end result.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
hello_world_device := class(creative_device):
# Runs when the device is started in a running game
OnBegin<override>()<suspends> : void =
Print("5 + -2 = {5 + -2}")
Print("15.0 / 7.0 = {15.0 / 7.0}")