
-----------------------------------
hez
Wed May 21, 2003 11:29 pm

[tutorial] For Extreme Newbies
-----------------------------------
maybe this should have been in the ""turing Help" forum but i wasn't sure..


This is for Serious newbies only, i will explain and show you the most common progs (I Think) that newbies want to 

know about :lol:



Using Font Tags:


var fontID:int:=Font.New("IMPACT:50:italic")

Font.Draw("TESTING!...", 250 , 200, fontID, black)


As you can see, font tags alow you to have a different font/size/color for your message rather than the default font in turing....

var fontID:int:=Font.New("IMPACT:50:italic") Allows you to specify which font/size/style your font will 

be and they have to be in that specific order.
Font.Draw("TESTING!...", 250 , 200, fontID, black) Allows you to write your font on the screen, "250" is the x axis spacing and "200" is the y axis spacing, 

try this and see if you can get the hang of it.

Fahreneit to Celsius

var celsius,fahrenheit: real
var counter:int:=0

put "Please enter a degree in fahrenheit"
get fahrenheit

celsius := 5/9 * (fahrenheit - 32)

put "When converted "..
put fahrenheit..
put " degrees fahrenheit into celsius it would be: ",celsius:50:2 ..
put " degrees celsius"

The main key in this program is the formula "5/9 * (fahrenheit - 32)" which converts from two bases... very easy

Minutes to Convert to Days, Hours and Minutes Left

var mins,hr1,min1,days1,hrleft: int


put " Please Enter the Number of Minutes to convert"
get mins

hr1:= mins div 60
days1:= hr1 div 24
min1:= mins mod 60
hrleft:= hr1 - days1 * 24

put "Days "..
put days1
put "Hours "..
put hrleft
put "Minutes "..
put min1

This program shows how to pass values when one value is full, and usage of "mod"(remainder) and div "(Divide without 

decimal places).

Area of an Triangle

var sd1,sd2,sd3,s,area: real

put "Please Enter the first side of the triangle"
get sd1

put "Please Enter the second side of the triangle"
get sd2

put "Please Enter the third side of the triangle"
get sd3

s:= (sd1 + sd2 + sd3) / 2
area:=( sqrt (s * (s-sd1) * (s-sd2) * (s-sd3) ) )



put "The area of the trangle would be "..
put area

This shows you how to use the forumla "( sqrt (s * (s-sd1) * (s-sd2) * (s-sd3) ) )" to figure out the area inside an 

triangle.

Slot Machine

var token : int := 100
var num1, num2, num3 : int
var ans : string


loop
    if token = 0 then
        play ("8>>b>>faba>>faba>>faba