Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Google's Simple is the new BASIC

DZone's Guide to

Google's Simple is the new BASIC

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

Google has released a simple, BASIC-like programming language called Simple. However, while the original BASIC language implementation was created as an educational tool to teach programming, Simple is intended for developing Android applications.

"Bringing an easy to learn and use language to the mobile world and the Android platform is the goal of the Simple project." - Herbert Czymontek.

According to Google, Simple programs are form definitions (which contain components) and code (which contains the program logic). The interaction between the components and the program logic happens through events triggered by the components. The program logic consists of event handlers which contain code reacting to the events.

Here is part of the Simple Tetris-like game source code:

' -----------------------------------------------------------------------------

' Analyze keyboard input

' -----------------------------------------------------------------------------

Event Tetris.Keyboard(keycode As Integer)

If keycode = Component.KEYCODE_BACK Then Finish()



If IsGameActive() Then

Select keycode

Case Component.KEYCODE_PAD_LEFT

BrickMoveLeft()



Case Component.KEYCODE_PAD_RIGHT

BrickMoveRight()



Case Component.KEYCODE_PAD_UP

BrickTurnRight()



Case Component.KEYCODE_PAD_DOWN

BrickTurnLeft()



Case Component.KEYCODE_PAD_CENTER, Component.KEYCODE_SPACE

BrickDropDown()

End Select

End If

End Event

Simple is available for Linux, Mac, and Windows. The source code for the implementation is freely available, along with sample applications.

(Please note that Simple is still a work in progress.)

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}