|
| ||||||||||
| Tags: clock, create, programming, small basic |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| How to create analog clock using Small Basic
Small Basic Small Basic is a language introduction to programming that emphasizes the idea of fun in programming. It is for this new Microsoft initiative aimed at encouraging more young people (7 to 77 years) to discover the joys of programming. - Download Small Basic - Install it by following the wizard step by step - At launch, Small Basic automatically recognizes the language of your system and adapts accordingly. In other words, the software displays an interface and help when launched on a Windows system. - In the following two steps, we will discover a new direction (Timer) function and the amazing publication very Web 2.0. |
|
#2
| ||||
| ||||
| re: How to create analog clock using Small Basic Using Timers The Timers can trigger the execution of a subprogram (SUB) at regular intervals. It is very good in games to move enemies or decorative elements. This is also useful when you want to automatically refresh a display. To implement a Timer, you must use the new keyword and TIMER functions. - We start by defining an interval using: TIMER.INTERVAL = x (where x is a number in milliseconds). For example: "Timer.Interval = 1000" trigger an event every second. - Then what tells the program sub-program must perform by giving it a name with TIMER.TICK = NameOfSub This gives something like this: ... Timer.Interval = 500 Timer.Tick = MoveTimer ... Sub MoveTimer 'Insert the code for moving enemies EndSub - To pause a timer, use the command: TIMER.PAUSE () - To restart a suspended Timer, use the command: TIMER.RESUME () |
|
#3
| ||||
| ||||
| re: How to create analog clock using Small Basic Delivering a clock The following program displays an analog clock with hands for hours and minutes, and its second hand seconds. Code: 'Beginning of program ' xRAD = math.pi / 180 ' GraphicsWindow.Height = 200 GraphicsWindow.Width = 200 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Show () ' Timer.Interval = 1000 ShowTime Timer.Tick = ' 'End of program ' Sub ShowTime Sec = 6 * Clock.Second Clock.Minute * min = 6 Heu Clock.Hour * = 30 ' GraphicsWindow.Clear () GraphicsWindow.PenColor = "Yellow" GraphicsWindow.DrawEllipse (0,0,200,200) ' X = 100 + (90 * Math.sin (xRAD * Sec)) Y = 100 - (90 * Math.Cos (xRAD * Sec)) GraphicsWindow.DrawLine (100.100, X, Y) ' GraphicsWindow.PenColor = "Green" X = 100 + (80 * Math.sin (xRAD * Min)) Y = 100 - (80 * Math.Cos (xRAD * Min)) GraphicsWindow.DrawLine (100.100, X, Y) ' GraphicsWindow.PenColor = "Red" X = 100 + (60 * Math.sin (xRAD Heu *)) Y = 100 - (60 * Math.Cos (Heu xRAD *)) GraphicsWindow.DrawLine (100.100, X, Y) ' GraphicsWindow.PenColor = "Cyan" GraphicsWindow.DrawBoundText (70150100, Clock.Time) EndSub |
|
#4
| ||||
| ||||
| re: How to create analog clock using Small Basic Publish and share Small Basic now offers a very simple way to share programs with friends. Once your program is fully finished and completed, simply click "Publish." Your source code is then sent to a special server that stores all Microsoft programs that are submitted. Once the server has received your program it returns a code (a sort of reference number). You can then communicate this code to your friends. They can then click Import and enter the code you've provided so that they can automatically download the source code and run it on their own Small Basic. Quote:
- Start Small Basic - Click on the Import icon - Enter MLT668-1 - Wait a few seconds the download code in a new window. This publication is very convenient to share programs and discover the products of other enthusiasts Small Basic. Some examples of emergency to discover: - Play LIGHTS OUT DanAwesome: VDK353 - Super Pong: MDJ923 - Bricks: QRQ360 |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to create analog clock using Small Basic" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create a clock in Silverlight using Expression Blend or Visual Studio | The$Hulk | Guides & Tutorials | 2 | 07-08-2010 06:05 AM |
| How to create software - Need basic guide | signupindia | Software Development | 1 | 19-06-2010 10:12 PM |
| How to create Windows DLL with Visual Basic? | Flaco | Software Development | 4 | 27-02-2010 03:39 AM |
| Create A Clock With Javascript | Sheenas | Software Development | 5 | 20-01-2010 01:48 PM |
| Create ActiveX dll with Visual Basic | B_Hodge | Software Development | 2 | 08-05-2009 10:28 PM |