2013年4月19日 星期五
2013年4月12日 星期五
1加到第n個數
<xml>
<block type="variables_set" inline="false" x="-1255" y="-859">
<title name="VAR">x</title>
<value name="VALUE">
<block type="text_prompt">
<title name="TYPE">NUMBER</title>
<title name="TEXT">請輸入你想知道1+到多少</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">y</title>
<value name="VALUE">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">z</title>
<value name="VALUE">
<block type="math_number">
<title name="NUM">0</title>
</block>
</value>
<next>
<block type="controls_for" inline="true">
<title name="VAR">i</title>
<value name="FROM">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
<value name="TO">
<block type="variables_get">
<title name="VAR">x</title>
</block>
</value>
<statement name="DO">
<block type="variables_set" inline="false">
<title name="VAR">z</title>
<value name="VALUE">
<block type="math_arithmetic" inline="true">
<title name="OP">ADD</title>
<value name="A">
<block type="variables_get">
<title name="VAR">y</title>
</block>
</value>
<value name="B">
<block type="variables_get">
<title name="VAR">z</title>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">y</title>
<value name="VALUE">
<block type="math_arithmetic" inline="true">
<title name="OP">ADD</title>
<value name="A">
<block type="variables_get">
<title name="VAR">y</title>
</block>
</value>
<value name="B">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="text_print" inline="false">
<value name="TEXT">
<block type="variables_get">
<title name="VAR">z</title>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
blockly 費氏數列
<xml>
<block type="variables_set" inline="false" x="-1491" y="-490">
<title name="VAR">x</title>
<value name="VALUE">
<block type="text_prompt">
<title name="TYPE">NUMBER</title>
<title name="TEXT">請輸入您想知道費氏數列第幾個數字??</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">y</title>
<value name="VALUE">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">z</title>
<value name="VALUE">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">k</title>
<value name="VALUE">
<block type="math_number">
<title name="NUM">0</title>
</block>
</value>
<next>
<block type="controls_for" inline="true">
<title name="VAR">i</title>
<value name="FROM">
<block type="math_number">
<title name="NUM">1</title>
</block>
</value>
<value name="TO">
<block type="math_arithmetic" inline="true">
<title name="OP">MINUS</title>
<value name="A">
<block type="variables_get">
<title name="VAR">x</title>
</block>
</value>
<value name="B">
<block type="math_number">
<title name="NUM">2</title>
</block>
</value>
</block>
</value>
<statement name="DO">
<block type="variables_set" inline="false">
<title name="VAR">k</title>
<value name="VALUE">
<block type="math_arithmetic" inline="true">
<title name="OP">ADD</title>
<value name="A">
<block type="variables_get">
<title name="VAR">z</title>
</block>
</value>
<value name="B">
<block type="variables_get">
<title name="VAR">y</title>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<title name="VAR">y</title>
<value name="VALUE">
<block type="variables_get">
<title name="VAR">z</title>
</block>
</value>
<next>
<block type="variables_set" inline="false">
<titl
訂閱:
意見 (Atom)





