Here's an example of the GotoJSE language. Please write any requested code using this language, and place your code inside syntax highlighted boxes. // GotoJSE Example // by JSEChat // GotoJSE is a retro version of BASIC. // Set up the Screen Don't forget to do this bit. It's important. Graphics 800,600 PosX=ScreenWidth()/2 PosY=ScreenHeight()/2 MessageColour=#FF8800 Message$="Hello World" // Array Declarations Dim NumF(10,3) // Create a 10x3 array Dim NumI(10,3) // Create a second array // You cannot pre-declare arrays. for m=0 to 9 for n=0 to 2 NumF(m,n)=Rnd(100) NumI(m,n)=Rand(100) next next Repeat // Main loop CLS 64,64,64 // Clear the screen in Dark Gray Starfield 0,2 // Speed of starfield, X=0, Y=2, so starfield falls down the screen For m=0 to 9 ResetDraw // Resets color, rotation, scale, linethickness, fontsize, etc. angle=((m*36)+(Mills()*0.1)) % 360 x=PosX+Cos(angle)*(ScreenWidth()/4) // Note that Sin and Cos are in Degrees, not Radians y=PosY+Sin(angle)*(ScreenHeight()/4) SetRot Mills()*0.1 SetSize Sin(angle)+1,Cos(angle)+1 // JSE uses Degrees, not Radians If m==0 // Where the 1 = Centered text SetColor 0,0,0:Text x,y,"Hello",1 EndIf // Always use an EndIf If m==5 SetFontSize 32:SetHue angle,1,1:Text x,y,"World",1 EndIf If m==1 // Rectangle SetHue angle*2,1,0.5 Rect x,y,32,32,1 // x,y,width,height, centered Endif // Note that we don't use the Else command. It sometimes works, but shouldn't be relied upon. If m==2 // Oval SetHue angle*4,0.5,1 // Hue, Sat, Value Oval x,y,32,32,32 // centre x, centre y, width, height, number of sides. Endif If m==3 // Triangle SetColor angle*0.3,angle*0.5,angle*0.7 // Red, Green, Blue Circle x,y,32,32,3 // centre x, centre y, width, height, number of sides. EndIf if m==4 SetColor 0,120,255:Line PosX,PosY,x,y EndIf if m==6 // Star SetColor 255,255,0 a=64 If GamePad(ButtonA)>0.5 a=160 // Make the star bigger if the A Button is being held. EndIf b=a/2 Star x,y,a,b,5 // centre x, centre y, Outer Size, Inner Size, Points endif if m==7 SetFontSize 32 Emoji x,y,"1F600",1 // To draw Emoji, we use the Emoji command. We need to use the last 5 hexadecimal characters of its unicode value.. eg 1F39A is a Level Slider endif if m==8 // Time ResetDraw SetColor 0,0,0 Text x,y,TimeString(),1 // TimeString() is the current time, "H:M:S", centered at x,y hours=TimeHour():mins=TimeMinute():secs=TimeSeconds() // other time values. days=DateDay():months=DateMonth():years=DateYear() // other time values. endif SetThick 8 if m==9 SetColor 120,255,0:Line PosX,PosY,x,y endif ResetDraw;SetColour MessageColour for n=0 to 2 x=PosX+Cos(angle)*32*(n+1) y=PosY+Sin(angle)*32*(n+1) Text x,y,NumI(m,n),1 x=PosX+Cos(angle)*32*(n+10) y=PosY+Sin(angle)*32*(n+10) Text x,y,NumF(m,n),1 next Next // Move Center using Joypad or Cursor Keys PosX=PosX+((GamePad(ButtonRight)-GamePad(ButtonLeft))*4) PosY=PosY+((GamePad(ButtonDown)-GamePad(ButtonUp))*4) Gosub AddMessage Flip // Display the drawn content and wait for VBL Forever // Main loop .AddMessage // A small subroutine Text ScreenWidth()/2,ScreenHeight()-16,Message$,1 Return // Return from the subroutine ***** Syntax Variables are multi-format, numerical or string, the language counts everything the same. Variables do not need to be declared, and are always classed as global variables. Arrays must be declared using the Dim command, and can have up to 4 dimensions "MyArray(a,b,c,d)" There are no functions in this language, only Gotos and Gosubs, with the appropriate line definition ( ".LineDefinition" at the start of a line. ) ***** Command List Here is a complete list of all commands available in GotoJSE // Program Flow If .condition. // Standard If EndIf // Standard Endif Repeat // Loops either "until" or "forever" Forever // End of a continuous loop Until .condition. // End of a conditional loop Wait seconds // Waits for the given number of seconds .labelName // Defines a label that can be used with Goto/Gosub. Goto labelName // Jumps to a given label. Labels are defined as .labelName at the start of a line. Gosub subroutineName // Jumps to a given subroutine. Subroutines are defined as .subroutine at the start of a line. Return // Returns from a subroutine. End // Ends the current program. For value=low To high .... Next // A standard for-loop Continue // Jumps to the next "Next" in a for-loop, skipping the rest of the current loop, but continuing to loop. Exit // Exits a for-loop, prematurely. Mills() // Returns the number of milliseconds since Jan 1970 Frames() // Returns the number of frames since the program started Flip // Draws everything to the front buffer, pauses until the next vsync. // Input Inkey() // Returns the last key pressed WaitMouse // Waits for a mouse button to be pressed WaitKey // Waits for a key to be pressed WaitGamepad // Waits for a button to be pressed on the gamepad WaitAny // Waits for a mouse button, or a key, or a gamepad button to be pressed. MouseHit() // Returns 1 if the mouse has been clicked since the last request. KeyHit() // Returns 1 if any key has been hit since the last request. GamepadHit() // Returns 1 if any gamepad face button has been tapped since the last request. // Mouse MouseX() // The mouse's X co-ordinate MouseY() // The mouse's Y co-ordinate MouseDown() // 1 if the left mouse button is currently being held, otherwise 0 MouseIn(x,y,w,h,centered) // Returns 1 if the Mouse is currently inside the given rectangle. MouseIn_Circle(x,y,diameter) // Returns 1 if the Mouse is currently inside the given circular area. // Touches. Note that in most cases, you can just use MouseX() and MouseY() since the first touch is always reproduced as Mouse co-ordinates. TouchX(Finger) // The X co-ordinate of an onscreen touch. TouchY(Finger) // The Y co-ordinate of an onscreen touch. TouchDown(Finger) // 1 if the finger is currently onscreen, otherwise 0 // Gamepad Gamepad(Button) // Returns 1 if the button is currently held. Button can be one of the following. ButtonLeft // Left ButtonRight // Right ButtonUp // Up ButtonDown // Down ButtonA // Primary button ButtonB // Secondary button ButtonY // Extra Button ButtonX // Another Button GamepadAng() // Returns the angle that the thumbstick of the controller is currently held at, in Degrees. 0 = up, 90 = right, 180 = down, 270 = left, etc GamepadDist() // Returns how far the thumbstick has been moved from the center, 0.0-1.0 // Numbers Int(value) // Returns a Trimmed integer of the given value Floor(value) // Returns a Floored integer of the given value Round(value) // Returns a Rounded integer of the given value Ceil(value) // Returns a Ceil integer of the given value Float(value) // Returns a float, represented by the value Abs(value) // Returns the positive value of a given value Neg(value) // Returns the negative value of a given value Sgn(value) // Returns 1 if the value is positive, or -1 if negative. If the value is 0, returns 0. Bin(value) // Returns the Binary representation of value BinToInt(binary value) // Converts a binary value back to integer Hex(value) // Returns the Hexadecimal representation of value HexToInt(Hexadecimal value) // Converts a Hexadecimal value back to integer Limit(value,low,high) // Clamps a value between the two limits. Wrap(value,low,high) // Wraps the value between the two limits. Between(value,low,high) // Returns 1 if the value is in-between the two limits, or 0 if outside the limits. Min(value,value2,[value3,value4,value5]) // Returns the lowest of the values Max(value,value2,[value3,value4,value5]) // Returns the highest of the values Swap a,b // Swaps the values of variables a and b // Complex Mathematics Exp(value) // Returns e to the power of value Log(value) // Returns the natural logarithm of value Log10(value) // Returns the base 10 logarithm of value Powers(a,b) // Returns the number of powers of A that make up B. Sqr(value) // Returns the Square Root of a given number Power(value,power) // Returns the power of the value. Sin(degrees) // Returns the Sin value of the given degrees Cos(degrees) // Returns the Cos value of the given degrees Tan(degrees) // Returns the Tan value of the given degrees aSin(value) // Returns the aSin value of the given value aCos(value) // Returns the aCos value of the given value aTan(value) // Returns the aTan value of the given value Pyth(a,b) // Returns the hypotenuse of a and b // Conversion RedToDeg(radians) // Returns Radians as Degrees DegToRad(degrees) // Returns Degrees as Radians RGB(r,g,b) // Returns a 24 bit integer with the value of r<<16+g<<8+b, where r, g and b are values between 0 and 255 HSL(h,s,l) // Returns a 24 bit integer with the colour represented by the h,s,v values. // Strings Chr(ascii) // Returns the character represented by the ascii value Asc(chr) // Returns the ascii value of the character Len(string) // Returns the length of the string Left(string,characters) // Returns the left side of a string, trimmed to the given number of characters Right(string,characters) // Returns the right side of a string, trimmed to the given number of characters Mid(string,start,length) // Returns the middle of a string, from the given start position, based on the length Instr(haystack,needle,[start]) // Searches for needle within haystack, returning either it's position in the string, or -1 if not found. Lower(string) // Returns the lowercase representation of a string Upper(string) // Returns the UPPERCASE representation of a string Title(string) // Returns the Title Case representation of a string Trim(string) // Returns the string without whitespace endings. Replace(string,search,replace) // Replaces the first occurrence of search with replace, within the string. ReplaceAll(string,search,replace) // Replaces all occurrences of search with replace, within the string. ReplaceAt(string,replace,position) // Replaces part of string with replace, starting at position. InsertAt(string,insert,position) // Inserts a new bit of the string, at the given position. Shuffle(string) // Shuffles the characters of the string Sort(string) // Sorts the characters of a string Reverse(string) // Reverses the characters in a string // Arrays Dim arrayName(size[,size2,size3,size4]) // Creates an array of the given size EmptyArray arrayName,value // Floods the array, setting it to the given value SortArray arrayName,order // Sorts the contents of the array, either 0 (low to high) or 1 (high to low) ReverseArray arrayName // Reverses the contents of the array ShuffleArray arrayName // Shuffles the contents of the array // Time TimeHours() // Returns the current time's Hour, 0-23 TimeMinutes() // Returns the current time's Minutes, 0-59 TimeSeconds() // Returns the current time's Seconds, 0-59 TimeString() // Returns a string, hh:mm:ss // Date DateYear() // Returns today's Year, yyyy DateMonth() // Returns today's Month, 1-12 DateDay() // Returns today's day of the month, 1-31 DateWeekday() // Returns a numerical representation of the day of the week, 1=Monday, 7 = Sunday DateWeekdayName() // Returns a string of today's day of the week, Monday to Sunday DateMonthName() // Returns the name of today's month, January to December DateString() // Returns today's date in the string format of "dd-mm-yyyy" // Random Numbers SeedRnd(value) // Gives the random number generator a new seed Rand(a,b) // Returns a random integer beween a and b, or 0 and a if no b is given Rnd(a,b) // Returns a random floating number beween a and b, or 0 and a if no b is given // Graphics Settings // All RGB values are 0-255,0-255,0,255 // All Alpha values are 0.0-1.0, where 1.0 is solid, and 0 is transparent Graphics width,height // Sets the screen to the given resolution CLS [r,g,b] // Clears the screen. If a colour is given, the screen will be cleared in that colour. SetCLSCol // Sets the colour for future CLS'ing Border r,g,b // Sets the border to the given rgb value. ScreenWidth() // Returns the width of the screen ScreenHeight() // Returns the height of the screen Scroll(x,y) // Scrolls the screen by the given offset // Drawing Settings ResetDraw() // Resets all current drawing settings SetCol r,g,b // Sets the drawing colour to the given rgb values SetHue h,s,l // Sets the drawing colour based on the Hue,Saturation and Light values. SetAlpha a // Sets the alpha to a value between 0.0 (transparent) and 1.0 (solid) GetRed() // The current red colour GetGreen() // The current green colour GetBlue() // The current blue colour GetAlpha() // The current alpha value SetSize w,h // Sets the scale of future drawings, where 1.0 is normal, 2.0 is double, 0.5 is half. SetRot degrees // Rotates future drawings by the given angle SetThick line width // Changes the width of future line drawings. SetSkew x,y // Skews the image by the given amount SetFontSize pixels // Changes the size of the font to fit the given height in pixels. // Drawing // Text Print string // Prints the string to the screen at the current text cursor's co-ordinates, with a newline at the end Write string // Prints the string to the screen at the current text cursor's co-ordinates, without a newline at the end Locate x,y // Moves the text cursor to the given co-ordinates CursorX() // Returns the text cursor's current X co-ordinate CursorY() // Returns the text cursor's current Y co-ordinate Text x,y,string,centered // Draws the string at the given position OutlineText x,y,string,centered // Draws the outline of a string at the given position Emoji x,y,Emoji,centered // Draws the emoji at the given position. Emoji should be given in the "U+1Fnnn" format. TextWidth(string) // Returns the pixel width of the string, given the current drawing settings TextHeight(string) // Returns the pixel height of the string, given the current drawing settings // Graphics Move x,y // Moves the graphics cursor to the given position Plot x,y // Plots a pixel at the given position Line(x,y,x2,y2) // Draws a line between x,y and x2,y2 // Returns a collision handle LineTo(x,y) // Draws a line between the current graphics cursor position, and x,y // Returns a collision handle LineR(DistanceX,DistanceY) // Draws a line from the current graphics cursor position, moving in the direction given. // Returns a collision handle ReadPixel(x,y) // Returns the current RGB value from the requested pixel Rect(x,y,width,height,centered) // Draw a filled rectangle from x,y, with the given width and height. If centered is 1, then the rectangle will be centered around the x,y co-ordinates. // Returns a collision handle DrawRect(x,y,width,height,centered) // Draw the outline of a rectangle from x,y, with the given width and height. If centered is 1, then the rectangle will be centered around the x,y co-ordinates. // Returns a collision handle Oval(x,y,width,height,sides) // Draws a filled oval with width and height, centered around x,y. You can set the number of sides to draw triangles or rectangles, hexagons and more. // Returns a collision handle DrawOval(x,y,width,height,sides) // Draws the outline of an oval with width and height, centered around x,y. You can set the number of sides to draw triangles or rectangles, hexagons and more. // Returns a collision handle Star x,y,radius,inner radius,points // Draws a filled star, with the given number of points, where the point extends to the size given, and the inside is the inside radius of the points. DrawStar x,y,radius,inner radius,points // Draws the outline of a star, with the given number of points, where the point extends to the size given, and the inside is the inside radius of the points. Light x,y,radius,strength // Draws a circular gradient, with the given radius, and a strength between 0.0 and 1.0, to be used for light effects. Starfield MoveX,MoveY // Draws a starfield on the screen, moving at the given speed. // Collisions Collide(CollisionHandle1,CollisionHandle2) // Returns 1 if the two objects are currently in contact, or 0 if not. // Audio PlaySfx("SoundName",rate) // Plays the sound at the given rate (1.0 = normal, 2.0 = twice as fast, 0.5 = half as fast) // Sound Library : The following sounds can be used. animal_quack beep_1 beep_2 beep_3 beep_4 beep_5 beeper_2tone_down beeper_2tone_up beeper_4tone_down beeper_4tone_up beeper_alert beeper_classic beeper_coin beeper_collect beeper_die beeper_die_2 beeper_fall beeper_fruit_bonus beeper_fruit_extra beeper_fruit_lose beeper_fruit_win beeper_jingle_down beeper_jingle_up beeper_jump beeper_powerup beeper_ring_high beeper_ring_low beeper_rise beeper_squiggle beeper_tada beeper_tada_lose beeper_toot_lose beeper_toot_win drum_low eat_1 eat_2 error error_2 error_3 error_4 error_5 explode_high_1 explode_high_2 explode_high_3 explode_high_4 explode_high_5 explode_low_1 explode_low_2 explode_low_3 explode_low_4 explode_low_5 explode_low_6 explode_low_7 gui_1 gun_1 gun_2 gun_3 gun_4 hit_1 hit_2 hit_3 hit_4 hurt_1 hurt_2 hurt_3 hurt_4 hurt_5 jump_1 jump_2 jump_3 jump_4 jump_5 jump_6 jump_7 jump_8 jump_9 lazer_1 lazer_10 lazer_11 lazer_12 lazer_2 lazer_3 lazer_4 lazer_5 lazer_6 lazer_7 lazer_8 lazer_9 metal_1 metal_2 metal_3 metal_4 metal_5 noise noise_burr_1 noise_burr_2 noise_crunch noise_fuse noise_hit noise_rustle noise_splash noise_spray_1 noise_spray_2 noise_stomp noise_tap noise_thud_1 noise_thud_2 noise_thud_3 noise_thud_4 peep_1 peep_2 peep_3 pickup_1 pickup_10 pickup_2 pickup_3 pickup_4 pickup_5 pickup_6 pickup_7 pickup_8 pickup_9 pop_high powerup_1 powerup_2 powerup_3 powerup_4 powerup_5 rat_1 rat_2 rat_3 rat_4 skid_1 skid_2 smash_1 sonniss_bottle_1 sonniss_bottle_2 sonniss_bottle_3 sonniss_bottle_4 sonniss_buzz sonniss_click sonniss_clicks sonniss_clunk sonniss_coin sonniss_coins sonniss_crack_1 sonniss_crack_2 sonniss_crunch sonniss_disk sonniss_drum sonniss_flop sonniss_glass sonniss_impact sonniss_plasmagun sonniss_pop_1 sonniss_pop_2 sonniss_rattle sonniss_rattle_metal sonniss_rock_1 sonniss_rock_2 sonniss_snap sonniss_spark_1 sonniss_spark_2 sonniss_spark_3 sonniss_spark_loud sonniss_squish_1 sonniss_squish_2 sonniss_squish_3 sonniss_stomp sonniss_swish_1 sonniss_swish_2 sonniss_swish_3 sonniss_swish_4 sonniss_swoosh sonniss_thud sonniss_thunk sonniss_torque sonniss_ui_1 sonniss_ui_10 sonniss_ui_2 sonniss_ui_3 sonniss_ui_4 sonniss_ui_5 sonniss_ui_6 sonniss_ui_7 sonniss_ui_8 sonniss_ui_9 sonniss_zip tap_1 warble_1 warble_2 warble_3 warble_4 warble_5 whistle_down whistle_up