प्ले ग्राउंड

TurtleAcademy learn programming for freeYour browser is not supporting canvas We recomand you to use Chrome or Firefox browsers

In order to save your program please login or रजिस्टर करें

Turtle Motion

forward X , fd X

टर्टल को x पॉइंट्स आगे सरकाता है

उदहारण:

forward 50

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

back X , bk X

टर्टल (कछुआ ) x पॉइंट्स पीछे

उदहारण:

back 50

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

left X , lt X

टर्टल (कछुए ) को लेफ्ट में x डिग्री घुमाएं

उदहारण:

left 90

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

right X , rt X

टर्टल (कछुए ) को राईट में x डिग्री घुमाएं

उदहारण:

right 90

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

home

टर्टल को सेण्टर तक ले जाता है (ऊपर की ओर देखते हुए)

उदहारण:

home

पाठ , लेसन में इसे समझाया गया है:

Turtle world

setx NUM_x

टर्टल को बताये हुए X लोकेशन तक ले जायें

उदहारण:

setx 100

पाठ , लेसन में इसे समझाया गया है:

Turtle world

sety NUM_y

टर्टल को बताये हुए Y लोकेशन तक ले जायें

उदहारण:

sety 200

पाठ , लेसन में इसे समझाया गया है:

Turtle world

setxy NUM_X NUM_Y , set pos [ NUM_X NUM_Y ]

टर्टल को बताये हुए लोकेशन तक ले जायें

उदहारण:

setxy 100 100

पाठ , लेसन में इसे समझाया गया है:

Turtle world

setheading , seth

टर्टल को बताये हुए हेडिंग की ओर घुमाएं

उदहारण:

sh 145

पाठ , लेसन में इसे समझाया गया है:

Turtle world

arc ANGLE RADIUS

इससे दिए गए RADIUS और ANGLE से एक आर्क बनेगा.

उदहारण:

ARC 360 5

पाठ , लेसन में इसे समझाया गया है:

Turtle world

ellipse WIDTH HEIGHT

Will create an ellipse with Width and height

उदहारण:

ellipse 80 90

Turtle Motion Queries

pos

टर्टल (कछुए ) की वर्तमान स्थिति [x y], x या y को दर्शाता है.

उदहारण:

pos

पाठ , लेसन में इसे समझाया गया है:

The turtle answer

xcor

टर्टल (कछुए ) की वर्तमान स्थिति [x y], x या y को दर्शाता है.

उदहारण:

xcor

पाठ , लेसन में इसे समझाया गया है:

The turtle answer

ycor

टर्टल (कछुए ) की वर्तमान स्थिति [x y], x या y को दर्शाता है.

उदहारण:

ycor

पाठ , लेसन में इसे समझाया गया है:

The turtle answer

heading

टर्टल (कछुए ) के हेडिंग की वर्तमान स्थिति को दर्शाता है.

उदहारण:

heading

पाठ , लेसन में इसे समझाया गया है:

The turtle answer

towards

हेडिंग को बताये हुए [x y] की ओर ले जाता है.

उदहारण:

towards

पाठ , लेसन में इसे समझाया गया है:

The turtle answer

Turtle and Window Control

showturtle , st

टर्टल (कछुए) को दिखाएं

उदहारण:

ht wait st

पाठ , लेसन में इसे समझाया गया है:

Controlling the Turtle and Pen

hideturtle , ht

कछुए को छिपाएं

उदहारण:

hideturtle

पाठ , लेसन में इसे समझाया गया है:

Controlling the Turtle and Pen

clean , cs

Will clear the screen

उदहारण:

fd 60 clean

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

clearscreen , cs

इससे स्क्रीन क्लियर होगा और टर्टल अपने शुरुआती स्थान (होम ) पर चला जाएगा

उदहारण:

cs

पाठ , लेसन में इसे समझाया गया है:

लोगो का टर्टल (कछुआ)

fill

Does a paint bucket flood fill at the turtle's position

उदहारण:

cs repeat 4 [ fd 50 rt 90 ] pu setxy 50 50 pd fill

पाठ , लेसन में इसे समझाया गया है:

Background

filled fillcolor [ statements ... ]

बिना ड्राइंग के स्टेटमेंट्स को एक्सीक्यूट करें लेकिन टर्टल की मूवमेंट पर नजर रखें. पूरा होने पर टर्टल ने जिस हिस्से को ट्रेस किया है उसे रंग दें. और साथ ही उसे आउटलाइन भी करें.

उदहारण:

filled "blue [repeat 4 [fd 100 rt 90]]

पाठ , लेसन में इसे समझाया गया है:

Background

label expr

Draw a word (same logic as print) on the graphics display at the turtle location

उदहारण:

label "logo ht

पाठ , लेसन में इसे समझाया गया है:

Background

setlabelheight expr

Set the height for text drawn by label, in pixels

उदहारण:

setlabelheight 100 label "Logo ht

पाठ , लेसन में इसे समझाया गया है:

Background

wrap

If the turtle moves off the edge of the screen it will continue on the other side

उदहारण:

cs wrap fd 800

पाठ , लेसन में इसे समझाया गया है:

The turtle borders

window

The turtle can move past the edges of the screen, unbounded.

उदहारण:

cs window fd 600 rt 90 fd 100 rt 90 fd 70

पाठ , लेसन में इसे समझाया गया है:

The turtle borders

fence

If the turtle attempts to move past the edge of the screen it will stop.

उदहारण:

cs fence fd 600 rt 90 fd 100 rt 90 fd 70

पाठ , लेसन में इसे समझाया गया है:

The turtle borders

Turtle and Window Queries

shownp , shown?

Outputs 1 if the turtle is shown, 0 if the turtle is hidden

उदहारण:

show shown?

पाठ , लेसन में इसे समझाया गया है:

Interactive

labelsize

Outputs the height of text drawn by label, in pixels

उदहारण:

show labelsize

पाठ , लेसन में इसे समझाया गया है:

Interactive

Pen and Background Control

penup , pu

टर्टल के पीछे निशान नहीं छुटेगा

उदहारण:

penup

पाठ , लेसन में इसे समझाया गया है:

Controlling the Turtle and Pen

pendown , pd

टर्टल (कछुए ) के पीछे निशान छुटेगा

उदहारण:

pendown

पाठ , लेसन में इसे समझाया गया है:

Controlling the Turtle and Pen

setcolor X , setpencolor X
इससे टर्टल का कलर नीचे दिए गए टेबल के अनुसार तय होगा.
0: black 1: blue 2: lime
3: cyan 4: red 5: magenta
6: yellow 7: white 8: brown
9: tan 10: green 11: aquamarine
12: सालमन 13: purple 14: orange
15: gray

उदहारण:

setcolor 1

पाठ , लेसन में इसे समझाया गया है:

Colors and printing

setcolor [r,g,b] , setpencolor [r,g,b]

इससे red , green और blue की मात्रा के अनुसार टर्टल का कलर ( रंग) तय होगा.

उदहारण:

setcolor [50 100 50]

setwidth X , setpensize X

इससे पेन की चौड़ाई X तय होगी.

उदहारण:

setwidth 4 fd 50

पाठ , लेसन में इसे समझाया गया है:

The pen width

changeshape X or STR , csh X or STR

इससे हम टर्टल की जगह अन्य प्राणियों के चित्र देख सकते हैं 0 = "turtle", 1 = "cat", 2 = "fish", 3 = "dog", 4 = "horse", 5 = "tiger", 6 = "crab", 7 = "snail"

उदहारण:

csh 1 or csh "dog

पाठ , लेसन में इसे समझाया गया है:

Turtle world

Pen Queries

pendownp , pendown?

Outputs 1 if the pen is down, 0 otherwise

उदहारण:

show pendown?

पाठ , लेसन में इसे समझाया गया है:

Interactive

pencolor , pc

Outputs the current pen color. This will be a CSS color string, not necessarily the value passed in.

उदहारण:

show pencolor

पाठ , लेसन में इसे समझाया गया है:

Interactive

pensize

Outputs a two element list with the pen width and height (usually the same).

उदहारण:

show pensize

पाठ , लेसन में इसे समझाया गया है:

Interactive

Procedure Definition

to PROCNAME inputs ... statements ... end

एक नया प्रोसीजर बनाएं जो जानकारी स्वीकार करे (ऑप्शनल इनपुट)

उदहारण:

to TURTLE repeat 4 [ fd 50 rt 90] end

पाठ , लेसन में इसे समझाया गया है:

The turtle is learning

define PROCNAME inputs ... statements ... end

Define a new named procedure with optional inputs

उदहारण:

define "star [[n][repeat 5 [fd :n rt 144]]]

def PROCNAME

Outputs the definition of a named procedure as a string

उदहारण:

show def "star

Variable Definition

make varname expr

एक वेरिएबल को अपडेट करें या नया ग्लोबल वेरिएबल बनाएं. वेरिएबल का नाम कोट में लिखें.

उदहारण:

make "foo 5

पाठ , लेसन में इसे समझाया गया है:

Variables

name expr varname

Like make but with the inputs reversed

उदहारण:

name 5 "myvar

पाठ , लेसन में इसे समझाया गया है:

No lesson yet

localmake varname expr

Define a variable in the local scope (shortcut for local then make

उदहारण:

localmake "myvar 5

पाठ , लेसन में इसे समझाया गया है:

No lesson yet

: VARNAME , thing VARNAME

Outputs the value of variable. :foo is a shortcut for thing "foo

उदहारण:

show thing "myvar

पाठ , लेसन में इसे समझाया गया है:

Variables

Control Structures

repeat X [ statements ... ]

स्टेटमेंट्स को X बार रिपीट करें

उदहारण:

repeat 4 [ fd 50 rt 90]

पाठ , लेसन में इसे समझाया गया है:

Loops

for controllist [ statements ...]

यह एक फॉर लूप है. कण्ट्रोल लिस्ट में तीन या चार मेंबर होते हैं. local varname, start value, limit value, और ऑप्शनल step size

उदहारण:

for [i 1 10 1] [print :i]

पाठ , लेसन में इसे समझाया गया है:

The for loop

repcount

रिपीट या फॉरएवर लूप कितनी बार रन हुआ ये दर्शाता है.

उदहारण:

repeat 4 [ repcount ]

if expr [statement]

Execute statment if expressoin is true

उदहारण:

if 2>1 [print "hello]

ifelse expr [statementTrue] [statementFalse]

Execute StatementTrue if tru else execute statementFalse

उदहारण:

ifelse 0>1 [print "true] [print "false]

test expr

Test the specified expression save the result in the local scope for the subsequent use by iftrue iffalse

उदहारण:

test 3>4 iftrue [print "true] iffalse [print "false]

iftrue [statements]

उदहारण:

test 3>4 iftrue [print "true] iffalse [print "false]

iffalse [statements]]

उदहारण:

test 3>4 iftrue [print "true] iffalse [print "false]

wait X

इससे कछुआ X सेकण्ड तक इंतज़ार करेगा और फिर कमांड को पूरा करेगा.

उदहारण:

repeat 4 [ wait 10 fd 50]

पाठ , लेसन में इसे समझाया गया है:

Hi wait

bye

Ternimante the program

उदहारण:

bye

dotimes [varname times] [ statements ...]

Run the statements the specified number of times. The variable varname is set to the current iteration number.

उदहारण:

dotimes [ i 5 ] [ show :i * :i ]

do.while [ statements ...] expr

Runs the specified statements at least once, and repeats while the expression is non-zero (true).

उदहारण:

do.while [ make "a random 10 show :a ] :a < 8

while [expr] [ statements ...]

Runs the specified statements only while the expression remains non-zero (true).

उदहारण:

while (random 2) = 0 [ show "zero ] show "one

do.until [ statements ...] [expr]

Runs the specified statements at least once, and repeats while the expression is zero (false).

उदहारण:

do.until [ make "a random 10 show :a ] :a < 8

until [expr] [ statements ...]

Runs the specified statements only while the expression remains zero (false).

उदहारण:

until (random 2) = 0 [ show "one ] show "zero

लिस्ट (सूची)

list thing1 thing2 ...

प्राप्त जानकारी (इनपुट) से एक नयी सूची (लिस्ट) बनाएं

उदहारण:

make "mylist (list "turtle "academy)

पाठ , लेसन में इसे समझाया गया है:

लिस्ट (सूची)

first listname

लिस्ट के पहले आइटम को दर्शाता है.

उदहारण:

print first :mylist

पाठ , लेसन में इसे समझाया गया है:

लिस्ट (सूची)

butfirst listname

लिस्ट नेम के सभी आइटम्स को ( पहले को छोड़ कर) दर्शाता है.

उदहारण:

print butfirst :mylist

पाठ , लेसन में इसे समझाया गया है:

Accessing the list

last listname

लिस्ट के लास्ट (अन्तिम) आइटम को दर्शाता है.

उदहारण:

print last :mylist

पाठ , लेसन में इसे समझाया गया है:

लिस्ट (सूची)

butlast listname

लिस्ट नेम के सभी आइटम्स को ( अन्तिम को छोड़ कर) दर्शाता है

उदहारण:

print butlast :mylist

पाठ , लेसन में इसे समझाया गया है:

Accessing the list

item index listname

लिस्ट या एरे के लास्ट (अन्तिम) आइटम को दर्शाता है.

उदहारण:

print item 1 :mylist

पाठ , लेसन में इसे समझाया गया है:

Accessing the list

pick index listname

लिस्ट के किसी भी एक आइटम को (रैंडम) दर्शाता है.

उदहारण:

print pick :mylist

पाठ , लेसन में इसे समझाया गया है:

Accessing the list

मैथ

sum X Y

Will sum x+y

उदहारण:

print sum 2 3

पाठ , लेसन में इसे समझाया गया है:

Variables

minus X Y

x और y के बीच का अंतर बताता है .( x -y )

उदहारण:

print minus 8 2

random X

इससे 0 और (X-1) के बीच का एक रैंडम नंबर चुना जाएगा

उदहारण:

cs print sum random 10 3

पाठ , लेसन में इसे समझाया गया है:

Colors and printing

modulo expr expr

रिमेंदर/मोदुलस (शेष /मापांक) को दर्शाता है.

उदहारण:

cs print modulo 10 3

power expr expr

3 power 4 = 81

उदहारण:

show power 3 4

Receivers

readword

Prompt the user for a line of input. The result (including spaces) is the single word output.

उदहारण:

make "name (readword [What is your name?]) show :name

पाठ , लेसन में इसे समझाया गया है:

Interactive

leerlista

Prompt the user for a line of input. The result is a list of words.

उदहारण:

make "colors (readlist [Type some colors:]) show :colors

Predicates

word thing , word? thing

Returns true (1) or false (0) if thing is a word

उदहारण:

show word "hello

listp thing , list? thing

Returns true (1) or false (0) if thing is a list

उदहारण:

print listp [1 2 3]

arrayp thing , array? thing

Returns true (1) or false (0) if thing is an array

उदहारण:

print arrayp array 2

numberp thing , number? thing

Returns true (1) or false (0) if thing is a number

उदहारण:

print numberp 25

emptyp thing , empty? thing

Test if thing is an empty list or empty string.

उदहारण:

print emptyp []

equalp expr expr , equal? expr expr

Test if xper expr are equal.

उदहारण:

equalp "no "yes

notequalp expr expr , notequal? expr expr

Test if xper expr are not equal.

उदहारण:

notequalp "no "yes

beforep thing1 , before? thing1

Test string collation order.

उदहारण:

print before? "bye "hi

substringp thing1 thing2 , substring? thing1 thing2

Test if thing1 is a substring of thing2.

उदहारण:

print substringp "hello "helloworld