Phrogram Kids Programming Language (KPL) v.2 Phrogram Beginnings • Creator: Jonah Stagner – Wanted a language to teach his kids to program, but didn’t think the available languages were kid-friendly enough. • KPL v.1 released in 2005 • Built on .NET framework Important Qualities of a Language for Kids Short learning curve to get started Very readable and writeable syntax A good IDE Easy way of creating graphics and using them for games Great books for continued learning and reference Getting Started with Phrogram • Comes with a Tutorial – Gets right into drawing and graphics • Example programs – Find out how to do things in Phrogram Phrogram Books • Learn to Program with Phrogram! – 109 page tutorial on the very basics of Phrogram • Three other books are in the works (Definitely lacking in this area so far) Readable/Writeable Syntax • Case Insensitive – (improves read/writeability) • No semicolon at the end of a statement – (slightly more writeable) IDE • Similar to Microsoft Visual Studio – Intelli-sense – Debugger Primitive Types • • • • Integer – 32 bit Whole number Decimal – 28 digits of precision Boolean – True or False String – String of characters. Use + operator to concatenate strings Declaring Variables • Define <variable name> As <type> • Define I As Integer • Define I As Integer = 4 • Define myString As String = “Hello” Method • Has no return value Method SayHello(Name As String) Print(“Hello ” + Name) End Method SayHello(“Mike”) Function • Has a return value Function GetPerimeter(Width As Decimal, Height As Decimal) As Decimal Return (2 * Width) + (2 * Height) End Function Define myPerimeter As Decimal myPerimeter = GetPerimeter(2.2, 9.1) Complex Data Types • Single and Multi-Dimensional Arrays • Structures and Classes – Structures only allow variables – Classes allow variables as well as Methods and Functions – NO INHERITANCE Classes Class Rectangle Width As Decimal Height As Decimal Function GetArea() As Decimal Return Width * Height End Function End Class Graphics Joystick Input • Define myJoystick As Joystick • Member variables & Functions that can be accessed from the Joystick object: – – – – – – IsConnected Stick1.X Stick1.Y Stick2.X Stick2.Y IsButtonPressed(number As Integer) As Boolean Joystick Input Does Phrogram Measure up? Short learning curve to get started Very readable and writeable syntax A good IDE Easy way of creating graphics and using them for games Great books for continued learning Not Yet! and reference Resources • http://kidsprogramminglanguage.com • http://phrogram.com/ • Schwartz, Jon, Learn to Program with Phrogram™!: A Guide to Learning Through Game Programming Using the Latest Version of Kids Programming Language, Addison Wesley, 2007. • http://en.wikipedia.org/wiki/Kids_Programming _Language Questions?