From Test-Scratch-Wiki

(Created page with "{{:Eng:C Block/translate}}frame|The general shape of a '''C block'''. A '''C block''' is a block that is shaped li...")
 
m
Line 1: Line 1:
{{:Eng:C Block/translate}}[[File:The shape of one of the C blocks.png|frame|The general shape of a '''C block'''.]]
+
{{:Eng:C Block/translate}}[[File:The shape of one of the C blocks.png|frame|'''C blokları''nın genel şekli'.]]
A '''C block''' is a [[Eng:Blocks|block]] that is shaped like a "C", so other blocks can fit inside it. These blocks perform the [[Eng:Boolean Block|conditions]] and loops.
+
Bir '''C bloğu''' "C" harfine benzeyen bir [[Tur:Bloklar|blok]] bloktur, böylece diğer bloklar içine girebilir. These blocks perform the [[Eng:Boolean Block|conditions]] and loops.
  
 
==Shape==
 
==Shape==
 
C blocks have a "mouth" (it looks like the letter "C", hence the name) {{-}} the blocks that will be played with the C block go in these mouths. All but one of the C blocks consist of one mouth {{-}} the other, [[Eng:If () Then, Else (block)|If () Then, Else]], consists of two mouths. When any of the other C blocks are dragged over a stack of blocks {{-}} if the C is empty {{-}} its mouth extends to ''wrap'' around them.
 
C blocks have a "mouth" (it looks like the letter "C", hence the name) {{-}} the blocks that will be played with the C block go in these mouths. All but one of the C blocks consist of one mouth {{-}} the other, [[Eng:If () Then, Else (block)|If () Then, Else]], consists of two mouths. When any of the other C blocks are dragged over a stack of blocks {{-}} if the C is empty {{-}} its mouth extends to ''wrap'' around them.
  
<scratchblocks>repeat (10)
+
<scratchblocks>(10) defa tekrarla
repeat until <(loudness) > [30]>
+
<(ses yüksekliği) > [30]> olana kadar tekrarla
glide (1) secs to x: (10) y: (0)
+
(1) sn.de to x: (10) y: (0)'a git
wait (1) secs
+
(1) saniye bekle
go to x: (0) y: (0)
+
x: (0) y: (0) konumuna git
 
end
 
end
play sound [meow v] until done
+
[meow v] sesini bitene kadar çal
 
end</scratchblocks>
 
end</scratchblocks>
  

Revision as of 06:56, 10 July 2019

Translate: - English - Türkçe - 한국어 
'C bloklarının genel şekli'.

Bir C bloğu "C" harfine benzeyen bir blok bloktur, böylece diğer bloklar içine girebilir. These blocks perform the conditions and loops.

Shape

C blocks have a "mouth" (it looks like the letter "C", hence the name) — the blocks that will be played with the C block go in these mouths. All but one of the C blocks consist of one mouth — the other, If () Then, Else, consists of two mouths. When any of the other C blocks are dragged over a stack of blocks — if the C is empty — its mouth extends to wrap around them.

(10) defa tekrarla
<(ses yüksekliği) > [30]> olana kadar tekrarla
(1) sn.de to x: (10) y: (0)'a git
(1) saniye bekle
x: (0) y: (0) konumuna git
end
[meow v] sesini bitene kadar çal
end

In 1.2.1 and earlier, C-block scripts could only be built one block at a time.

Blocks

In Scratch 2.0, there are five C blocks, and they can all be found in the Control category.

The Forever If () block.

In Scratch 1.4 and earlier, there was also a Forever If () block. It was replaced with its workaround.

forever
if <> then

Uses

As C blocks are for checks and loops, they are used almost everywhere. Some uses include:

  • Things that must go on forever
when gf clicked
forever
turn cw (15) degrees
  • Checking a condition
when [space v] key pressed
if <(loudness) > [30]> then
stop [all v]
end
  • Repeating an animation a certain amount of times
when gf clicked
repeat (200)
turn ccw (36) degrees
change [color v] effect by (1)
end

Here is an example for both checks and looping:

when I receive [Decrease health v]
change [Health v] by (-1)
if <(health) = [0]> then
repeat (8)
change [color v] effect by (25)
end
end
  • Starting/Stopping
when gf clicked
if<key [space v] pressed?> then
stop [all v]
else
end

There is a check (the If () Then block is checking if the variable Health has a value of 0), and inside the check is a repeat loop (with the Repeat () block). Note how C blocks can be placed inside other C blocks.