From bc598318bd130ac964cf150a10aa79f3f01a005d Mon Sep 17 00:00:00 2001 From: performance Date: Wed, 20 Dec 2023 18:17:53 -0800 Subject: [PATCH] Added Chinese + fixed typo in Telugu --- INFORMATION.md | 394 +++++++++--------- examples.js | 364 +++++++++++++++- .../Chinese/\346\227\266\351\222\237.js" | 102 +++++ .../\346\255\243\346\226\271\345\275\242.js" | 23 + .../Chinese/\346\262\231\347\225\253.js" | 28 ++ .../Chinese/\347\243\232\347\211\206.js" | 46 ++ .../Chinese/\350\233\213\345\275\242.js" | 23 + .../Chinese/\351\233\252\350\212\261.js" | 51 +++ "examples/Chinese/\351\261\274.js" | 41 ++ ...76\340\260\260\340\260\256\340\261\201.js" | 32 +- ...62\340\261\215\340\260\262\340\261\200.js" | 2 +- index.html | 17 +- old-ex.js | 43 +- other_examples/arc_test.js | 8 +- other_examples/intersection_simulator.js | 2 +- other_examples/plot_with_bubbles.js | 8 +- reference.html | 14 +- scripts/belarusian/keymap.sed | 4 +- scripts/bulgarian/bulgarian.js | 4 +- scripts/bulgarian/keymap.sed | 4 +- scripts/chinese/chinese.js | 48 +++ scripts/chinese/keymap.sed | 79 ++++ scripts/french/french.js | 6 +- scripts/french/keymap.sed | 6 +- scripts/korean/kmap | 4 +- scripts/korean/kmap.sed | 4 +- scripts/marathi/keymap.sed | 4 +- scripts/marathi/marathi.js | 6 +- scripts/spanish/keymap.sed | 6 +- scripts/spanish/spanish.js | 5 +- ...\340\260\232\340\260\277\340\260\225.html" | 18 +- ...02\340\260\232\340\260\277\340\260\225.js" | 111 +++-- ...260\232\340\260\277\340\260\225Console.js" | 30 ++ ...\340\262\232\340\262\277\340\262\225.html" | 16 +- 34 files changed, 1206 insertions(+), 347 deletions(-) create mode 100644 "examples/Chinese/\346\227\266\351\222\237.js" create mode 100644 "examples/Chinese/\346\255\243\346\226\271\345\275\242.js" create mode 100644 "examples/Chinese/\346\262\231\347\225\253.js" create mode 100644 "examples/Chinese/\347\243\232\347\211\206.js" create mode 100644 "examples/Chinese/\350\233\213\345\275\242.js" create mode 100644 "examples/Chinese/\351\233\252\350\212\261.js" create mode 100644 "examples/Chinese/\351\261\274.js" create mode 100644 scripts/chinese/chinese.js create mode 100644 scripts/chinese/keymap.sed diff --git a/INFORMATION.md b/INFORMATION.md index efd5a733..89651231 100644 --- a/INFORMATION.md +++ b/INFORMATION.md @@ -12,21 +12,21 @@ This project consists of several files which are used for a single HTML page. - **కుంచిక.css** controls the formatting and styling of the page. - **కుంచిక.js** contains the Javascript code for the Logo Turtle Javascript functions. This code could be included in other projects that want కుంచిక -graphics without the console functions. + graphics without the console functions. - **కుంచికConsole.js** contains the Javascript code for the platform controls (e.g., language reference -clickons, **Command** box, **RESET** button, **RUN DEMO** button, **STOP** button) + clickons, **Command** box, **RESET** button, **RUN DEMO** button, **STOP** button) - **examples** is a directory the contains example code in both a native form (e.g., example.js) and in a string assignment (e.g., example.str.js) form -where the native form is passed as a Javascript string variable to be included -in the platform. + where the native form is passed as a Javascript string variable to be included + in the platform. - **examples.js** is the file containing the processed example code for inclusion in the console. It is built with the **make** command (see below). - **Makefile** used for maintaining the example Javascript code files for inclusion into the platform page (see below). - **jsTojsString** is an executable shell script for converting a Javascript example programs into a Javascript string which can be loaded into the -**Example** box (see below). + **Example** box (see below). - **README.md** is the general read me documentation file for this project and includes a basic user manual. - **INFORMATION.md** is this documentation file. @@ -49,237 +49,235 @@ track of when a particular example program file needs to be updated. This allows the updating to be performed with a simple **make** command. New example files require: + - inclusion within the **Makefile** so that they are updated with the **make** command. - inclusion of the Javascript string files (e.g., <script src=example.str.js></script>) within the **కుంచిక.html** so that the -strings are accessible to Javascript. + strings are accessible to Javascript. - inclusion of the <option> in the **Examples** select within **కుంచికConsole.js** file. -##Initial Enhancements + ##Initial Enhancements The following are the initial enhancements to the forked project: -* re-formatted the language reference to use and unordered list and paragraph tags. -* dropped jQuery thinking that it really wasn't needed and wanted the code to be "easier" to read in the sence that one would have to know less to read it. With the number of onclick events, this is now somewhat questionable. -* made the **language reference**examples be "clickable", so that they load the **command** line -and are executed when clicked. -* added synonyms for commands (e.g., colour=color, fd=forward). -* added **xనియోగించు()** to **yనియోగించు()** functions to change only the x or y coodinate. -* changed **రంగు_మార్చు()** to use 16 *standard* logo colors (integer) as well as strings for -all of the Javascript color variations. -* added buttons and samples of the 16 logo *standard* colors to the reference. -* changed **వ్రాయి()** function to apply text along direction of కుంచిక. -* added **కుడివైపు_చాపాము()** and **ఎడమవైపు_చాపాము()** functions to draw arcs with the కుంచిక. -* changed **circle** function to draw circles or arcs centered on the కుంచిక. -* added **నిండు_వృత్తము()** function to draw filled circles centered on the కుంచిక. -* changed **యాదృచ్ఛిక_సంఖ్య()** function to allow use with only a high value. -* added **Stop** button for animations. -* added **విలంబించు()** function as an alternative for animations. -* added **విధిమ్ చాలయన్తు** button for example code in the **definitions** box. -* added select element for selecting and loading Javascript examples. -* developed the shell tools to convert Javascript examples into strings that can be -dynamically loaded into the **definitions** box. -* changed various examples to make them work with the above language changes. - +- re-formatted the language reference to use and unordered list and paragraph tags. +- dropped jQuery thinking that it really wasn't needed and wanted the code to be "easier" to read in the sence that one would have to know less to read it. With the number of onclick events, this is now somewhat questionable. +- made the **language reference**examples be "clickable", so that they load the **command** line + and are executed when clicked. +- added synonyms for commands (e.g., colour=color, fd=forward). +- added **xనియోగించు()** to **yనియోగించు()** functions to change only the x or y coodinate. +- changed **రంగు_మార్చు()** to use 16 _standard_ logo colors (integer) as well as strings for + all of the Javascript color variations. +- added buttons and samples of the 16 logo _standard_ colors to the reference. +- changed **వ్రాయి()** function to apply text along direction of కుంచిక. +- added **కుడివైపు_చాపము()** and **ఎడమవైపు_చాపము()** functions to draw arcs with the కుంచిక. +- changed **circle** function to draw circles or arcs centered on the కుంచిక. +- added **నిండు_వృత్తము()** function to draw filled circles centered on the కుంచిక. +- changed **యాదృచ్ఛిక_సంఖ్య()** function to allow use with only a high value. +- added **Stop** button for animations. +- added **విలంబించు()** function as an alternative for animations. +- added **విధిమ్ చాలయన్తు** button for example code in the **definitions** box. +- added select element for selecting and loading Javascript examples. +- developed the shell tools to convert Javascript examples into strings that can be + dynamically loaded into the **definitions** box. +- changed various examples to make them work with the above language changes. ##Things To Do + - [x] develop a test example that tests the various features of the extensions. - [x] clean up the triggers for the tags -- [X] handle errors better. Logo used a red background and white text at bottom of canvas for -its errors. This implements red text on a white background -- [X] make the design responsive to work on smaller screens. -- [X] added a drawer handle to the **language reference** to allow it to be closed and give -more room to the canvas. +- [x] handle errors better. Logo used a red background and white text at bottom of canvas for + its errors. This implements red text on a white background +- [x] make the design responsive to work on smaller screens. +- [x] added a drawer handle to the **language reference** to allow it to be closed and give + more room to the canvas. - [x] allow the examples select and **definitions** box to be hidden to give more room to the canvas. - [x] make the command box execute on a second ENTER without other changes (onkeypress?) -- [X] విలంబించు() needs to have a way to turn off the **Stop** button. Perhaps it could include this in -the delayed function mechanism. +- [x] విలంబించు() needs to have a way to turn off the **Stop** button. Perhaps it could include this in + the delayed function mechanism. - [ ] add a page of example outputs - - [ ] make each output the same size - - [ ] make each example fill the canvas - - [ ] create a make file to process the .png's (especially creating .gif's) - - [ ] example page should be auto generated and fully responsive + - [ ] make each output the same size + - [ ] make each example fill the canvas + - [ ] create a make file to process the .png's (especially creating .gif's) + - [ ] example page should be auto generated and fully responsive - [ ] link the examples to the IDE with the example loaded - [ ] add more examples: - - [x] fix arc and cirle test to test 360 degree arcs from various angles and rotations - - [x] fix arc and cirle test to be proportional for the turbine - - [x] Koch snowflake - - [x] వృత్తము eye - - [x] dividing a circle - - [x] random stick men - - [x] jumping jack - - [ ] walking stick man - - [x] hexagon tesselation - - [x] simple traffic light simulator - - [x] integrate intersection simulator - - [x] more fractal examples - - [x] Sierpinski triangle - - [x] dragon curve - - [x] Hilbert curve - - [x] Gosper curve - - [x] Conway pinwheel - - [ ] asymmetric tree - - [ ] more tessellation examples - - [x] pentagons - - [ ] herring bone - - [ ] squares - - [ ] shifted squares - - [ ] two square sizes - - [ ] triangles - - [ ] shifted trangles - - [x] two triangle size - - [x] Conway Pinwheel - - [x] star evolution - - [x] basic 5-pointed star - - [x] open up points - - [x] move star (dx, dy) - - [x] grow star (dSize) - - [x] spin star (dAngle) - - [x] move and grow and spin star - - [x] acceleration - - [x] array of stars + - [x] fix arc and cirle test to test 360 degree arcs from various angles and rotations + - [x] fix arc and cirle test to be proportional for the turbine + - [x] Koch snowflake + - [x] వృత్తము eye + - [x] dividing a circle + - [x] random stick men + - [x] jumping jack + - [ ] walking stick man + - [x] hexagon tesselation + - [x] simple traffic light simulator + - [x] integrate intersection simulator + - [x] more fractal examples + - [x] Sierpinski triangle + - [x] dragon curve + - [x] Hilbert curve + - [x] Gosper curve + - [x] Conway pinwheel + - [ ] asymmetric tree + - [ ] more tessellation examples + - [x] pentagons + - [ ] herring bone + - [ ] squares + - [ ] shifted squares + - [ ] two square sizes + - [ ] triangles + - [ ] shifted trangles + - [x] two triangle size + +- [x] Conway Pinwheel +- [x] star evolution + - [x] basic 5-pointed star + - [x] open up points + - [x] move star (dx, dy) + - [x] grow star (dSize) + - [x] spin star (dAngle) + - [x] move and grow and spin star + - [x] acceleration + - [x] array of stars - [ ] star burst... just lines that emanate from the center - [ ] interconnected points moving at different velocities - [x] digital clock with 7-segment display - - [x] function to draw segmented display from segment map - - [x] function to convert digit to segment map + - [x] function to draw segmented display from segment map + - [x] function to convert digit to segment map - [x] digital clock with binary number display - - [x] function to draw binary number with dots - - [ ] Do year (hundreds), month, day, hour, minute, sec, 1/100 sec - - [ ] Add field labels + - [x] function to draw binary number with dots + - [ ] Do year (hundreds), month, day, hour, minute, sec, 1/100 sec + - [ ] Add field labels - [ ] re-label current binary clock as a BCD clock and maybe add year month day + field labels - [x] compass rose - [x] వృత్తము limit compass rose - [ ] want to add something to make the project more interactive - - [ ] buttons - - [ ] values - - [ ] slider values -- [X] development tools to automatically add examples to the code by placing a '.js' file in -'examples' directory with the Linux 'make' command. This is partially done, but needs improvements. -It would be better to combine all of the outputs into a single .js file. Perhaps that file could -also configure the examples select. + - [ ] buttons + - [ ] values + - [ ] slider values +- [x] development tools to automatically add examples to the code by placing a '.js' file in + 'examples' directory with the Linux 'make' command. This is partially done, but needs improvements. + It would be better to combine all of the outputs into a single .js file. Perhaps that file could + also configure the examples select. - [x] develop lessons to lead a student throught some basic programming concepts. [This may be a -separate selector from the example selector]. - - [x] moving the కుంచిక and executing a command - - [x] drawing a square - - [x] using iteration to draw a square - - [x] using a function to draw many squares - - [x] using recursion to do something repeatedly (Koch snowflake) - - [x] animating a function - - - [ ] make the definitions pane stand out more by moving the examples select to the bottom of that pane - - [ ] make it more obvious that the definitions pane can be modified - - [ ] A better way to control positioning of the three panels, like some sort of sliding division - - [ ] Get more error messages to show up, especially when pressing "RUN" - - [ ] Fix the Run button, so that it executes the command line also. - - [ ] A way to fill a closed polygon - - [ ] this may be a mode that turns off the incremental drawing: fillStart, fillEnd - - [ ] such a feature may be great for drawing the fractals also - - [ ]Better integration of an instructional pane - - [ ] It should have a lesson: some instruction and some things to do - - [ ] It should have a ghost outline of something to draw - - [ ] It should make sure that the student has accomplised the task. - - [ ] This really duplicates what is done on the Kahn code academy... is this what you want to do?? - - [ ] should have load and save capability to encourage program development - - [ ] maybe record things clicked on the language reference to build programs more easily - - [ ] do you need lint? would that be easy to add? - - [ ] do you need syntax highlighting? or at least discuss it. - - [ ] include the intersection simulator as an example of using the కుంచిక.js as a library on a standalone page. - - [ ] figure out how to load examples on the fly. - - [ ] figure out a way to display examples hierarchically - - [ ] bring in bitsbox style commands (more like javascript) - - [ ] display the cursor x, y coordinates somewhere + separate selector from the example selector]. +- [x] moving the కుంచిక and executing a command +- [x] drawing a square +- [x] using iteration to draw a square +- [x] using a function to draw many squares +- [x] using recursion to do something repeatedly (Koch snowflake) +- [x] animating a function +- [ ] make the definitions pane stand out more by moving the examples select to the bottom of that pane +- [ ] make it more obvious that the definitions pane can be modified +- [ ] A better way to control positioning of the three panels, like some sort of sliding division +- [ ] Get more error messages to show up, especially when pressing "RUN" +- [ ] Fix the Run button, so that it executes the command line also. +- [ ] A way to fill a closed polygon + - [ ] this may be a mode that turns off the incremental drawing: fillStart, fillEnd + - [ ] such a feature may be great for drawing the fractals also +- [ ]Better integration of an instructional pane + - [ ] It should have a lesson: some instruction and some things to do + - [ ] It should have a ghost outline of something to draw + - [ ] It should make sure that the student has accomplised the task. + - [ ] This really duplicates what is done on the Kahn code academy... is this what you want to do?? +- [ ] should have load and save capability to encourage program development +- [ ] maybe record things clicked on the language reference to build programs more easily +- [ ] do you need lint? would that be easy to add? +- [ ] do you need syntax highlighting? or at least discuss it. +- [ ] include the intersection simulator as an example of using the కుంచిక.js as a library on a standalone page. +- [ ] figure out how to load examples on the fly. +- [ ] figure out a way to display examples hierarchically +- [ ] bring in bitsbox style commands (more like javascript) +- [ ] display the cursor x, y coordinates somewhere #Bugs -* make the run button better - - [ ] if ప్రదర్శన() is undefined, just say "Run" - * [ ] make enter work all of the time on the command line - * [ ] ప్రదర్శన() needs to be cleared when changing examples (e.g., flag to clock, binary) - * [ ] ప్రదర్శన() may be should be called automatically when the example is loaded -* [ ] add a visible version number to this thing somewhere -* [ ] need some protection from infinite loops (hard to do without injecting code somewhere)mo -* [ ] arc and curve test is missing third example - * Should add example for rounded rectangles -* [ ] hexagon tessellation is not working -* [ ] వృత్తము eye could be bigger, maybe different colors for each inscribed circle -* [ ] color changing dots is not working, should start with a చెరిపి_వేయి -* [ ] dividing a వృత్తము is not working *****Fixed without identifying problem***** -* [ ] Add tag //*sourceURL=foo.js to bottom of all examples for debugging purposes (or just add ~=definitions.js via the exec command?) <--alternate is better because it works for user entered code -* optionally -* [ ] కుడివైపు_చాపాము and ఎడమవైపు_చాపాము are not working from all start angles -* [ ] run demo is rough - - should be consistent about errors - - need to catch errors in repeat and delay and STOP! -* [ ] names in reference aren't proper camel case -* [ ] కుంచిక context not saved and restored properly - color, కోణము, position, width is not restored -* [ ] error handling is inconsistant -* [ ] examples should be consistant - - [ ] include ప్రదర్శన() - - [ ] include ఆది_స్థితి() -* [ ] add example checker - - [ ] no single quote - - [ ] Name Capitalized - - [ ] demo function - - [ ] reset function? ok for those that build like graphitti -* [ ] can a pause button be implemented? -- just an asyncronous event -* [ ] resume uses the play/run button. If pause in progress, resume, else play from start -* [ ] ఆది_స్థితి() sets stokeStyle to "నలుపు". is that complete? - [ ] see also other references... +- make the run button better + - [ ] if ప్రదర్శన() is undefined, just say "Run" + * [ ] make enter work all of the time on the command line + * [ ] ప్రదర్శన() needs to be cleared when changing examples (e.g., flag to clock, binary) + * [ ] ప్రదర్శన() may be should be called automatically when the example is loaded +- [ ] add a visible version number to this thing somewhere +- [ ] need some protection from infinite loops (hard to do without injecting code somewhere)mo +- [ ] arc and curve test is missing third example + - Should add example for rounded rectangles +- [ ] hexagon tessellation is not working +- [ ] వృత్తము eye could be bigger, maybe different colors for each inscribed circle +- [ ] color changing dots is not working, should start with a చెరిపి_వేయి +- [ ] dividing a వృత్తము is not working **\***Fixed without identifying problem**\*** +- [ ] Add tag //\*sourceURL=foo.js to bottom of all examples for debugging purposes (or just add ~=definitions.js via the exec command?) <--alternate is better because it works for user entered code +- optionally +- [ ] కుడివైపు*చాపము and ఎడమవైపు*చాపము are not working from all start angles +- [ ] run demo is rough + - should be consistent about errors + - need to catch errors in repeat and delay and STOP! +- [ ] names in reference aren't proper camel case +- [ ] కుంచిక context not saved and restored properly + color, కోణము, position, width is not restored +- [ ] error handling is inconsistant +- [ ] examples should be consistant + - [ ] include ప్రదర్శన() + - [ ] include ఆది_స్థితి() +- [ ] add example checker + - [ ] no single quote + - [ ] Name Capitalized + - [ ] demo function + - [ ] reset function? ok for those that build like graphitti +- [ ] can a pause button be implemented? -- just an asyncronous event +- [ ] resume uses the play/run button. If pause in progress, resume, else play from start -* [ ] decahedron graph does not auto start while animation in progress -* [ ] need to reset -* [ ] n drop first examples -* [ ] hirshhorn name not loading. -* [ ] niefah mizen6 has missing figure -* [ ] niefah mizen has black edge inconsistantly showing -* [ ] squiggle needs a reset -* [ ] miura should be scaled a bit ... 1-2 inches, at least 5x5 -* [ ] rotate mountain tesselation 90° -* [ ] pentahex needs to be scaled -* [ ] rhombic star should hide కుంచిక -* [ ] rice pentellation needs more fill +- [ ] ఆది_స్థితి() sets stokeStyle to "నలుపు". is that complete? + [ ] see also other references... -*tutorial got really short. should at least have progression on the square. -tutorial has bugs +- [ ] decahedron graph does not auto start while animation in progress +- [ ] need to reset +- [ ] n drop first examples +- [ ] hirshhorn name not loading. +- [ ] niefah mizen6 has missing figure +- [ ] niefah mizen has black edge inconsistantly showing +- [ ] squiggle needs a reset +- [ ] miura should be scaled a bit ... 1-2 inches, at least 5x5 +- [ ] rotate mountain tesselation 90° +- [ ] pentahex needs to be scaled +- [ ] rhombic star should hide కుంచిక +- [ ] rice pentellation needs more fill +\*tutorial got really short. should at least have progression on the square. +tutorial has bugs *fix icons to make more consistant *credit icons -
Icons made by Robin Kylander from www.flaticon.com is licensed by CC 3.0 BY
- - - +
Icons made by Robin Kylander from www.flaticon.com is licensed by CC 3.0 BY
#Proposed Turtle Graphics Lesson Outline - Environment - - The panes - - The buttons - - Help + - The panes + - The buttons + - Help - First steps, basic drawing - - Forward - - Backward - - Right - - Left - - వ్రాయి(Hello World) + - Forward + - Backward + - Right + - Left + - వ్రాయి(Hello World) - Repeat loop - - Drawing a square - - Repeat - - While - - for + - Drawing a square + - Repeat + - While + - for - then add size - Pen control - - Pen up - - Pen down - - Color - - Pen size/width + - Pen up + - Pen down + - Color + - Pen size/width - Function - - Random - - variables… show polygon functions. first #sides - Stamping + - Random + - variables… show polygon functions. first #sides - Stamping - స్థానము_మార్చు(x,y) - Set heading/కోణము - xనియోగించు @@ -287,14 +285,14 @@ tutorial has bugs - Variables - Parameters - Arcs and curves - - ఎడమవైపు_చాపాము - - కుడివైపు_చాపాము - - Circle - - Dot + - ఎడమవైపు_చాపము + - కుడివైపు_చాపము + - Circle + - Dot - Conditionals - Recursion - - Koch snowflake - - Sierpinski triangle + - Koch snowflake + - Sierpinski triangle - Animation - - Animate - - Delay + - Animate + - Delay diff --git a/examples.js b/examples.js index 52468d71..df47ea9f 100644 --- a/examples.js +++ b/examples.js @@ -666,6 +666,336 @@ _метод_ показване() {\n\ }\n\ ' // End Bulgarian +// Begin Chinese +鱼 ='\ +平方根 = Math.sqrt;\n\ +\n\ +演示 = () => {\n\ + 初始状态();\n\ + 隐藏笔刷();\n\ +\n\ + 鱼 = (వ) => {\n\ + 圆形(వ);\n\ + 向右转(90);\n\ +\n\ + 抬起笔刷();\n\ + 向前移动(వ);\n\ + 放下笔刷();\n\ +\n\ + 显示笔刷();\n\ +\n\ + 向左转(45);\n\ + 向前移动(2 * వ);\n\ + 向右转(90 + 45);\n\ +\n\ + 向前移动(平方根(2 * వ * 2 * వ * 2));\n\ +\n\ + 向右转(90 + 45);\n\ + 向前移动(2 * వ);\n\ + 向左转(45);\n\ +\n\ + // 隐藏笔刷();\n\ +\n\ + 抬起笔刷();\n\ + 向前移动(వ);\n\ + 放下笔刷();\n\ +\n\ + 向右转(90);\n\ + };\n\ +\n\ + 颜色_鱼 = (颜色编号) => {\n\ + 改变颜色为(颜色编号);\n\ + 鱼(40 + 颜色编号 * 1);\n\ + };\n\ + 计数并重复(16, (క) => 颜色_鱼(క));\n\ +};\n\ +' +时钟 ='\ +// గోడ 时钟\n\ +\n\ +_到处_ కొలత;\n\ +\n\ +// 时钟 చుట్టూ క్షణముల గీతలు గీయుటకు\n\ +_步骤_ క్షణముల_గీతలు(x, y, వ్యాసార్థము) {\n\ + _此处_ గీత_长度 = 7;\n\ + _此处_ ఖాళీ = వ్యాసార్థము - గీత_长度;\n\ + 改变颜色为( 1 ); // 蓝色 \n\ + 宽度(1);\n\ + 计数并重复( 60, ( కో ) => {\n\ + _此处_ థీటా = కో * 6;\n\ + // ప్రతి ఐదవది దళసరి గా వేయవలెను\n\ + 宽度( ( ( కో % 5 ) ? 1 : 3)/130* కొలత)\n\ + 抬起笔刷();\n\ + 改变位置(0,0);\n\ + 角度(థీటా);\n\ + 向前移动(ఖాళీ);\n\ + 放下笔刷();\n\ + 向前移动(గీత_长度);\n\ + });\n\ + \n\ +}\n\ +\n\ +\n\ +// గంటలు, నిమిషాలూ సూచించే అంకెలు\n\ +_步骤_ అంకెలు(x, y, వ్యాసార్థము) {\n\ + 抬起笔刷();\n\ + _此处_ అక్షర_尺寸 = 20/130 * కొలత\n\ + 设置字体(అక్షర_尺寸+"px sans-serif");\n\ + 改变颜色为("నలుపు");\n\ + 计数并重复( 12, ( గంట ) =>{\n\ + 改变位置(x,y);\n\ + 角度(గంట * 30);\n\ + 向前移动(వ్యాసార్థము); // to center of digit\n\ + 角度(180);\n\ + 向前移动(10/130 * కొలత); // vertical correction to baseline\n\ + 向右转(90);\n\ + // క్రింది, ఎడమ భాగమునకు అనుప్రస్థ సరదుబాటు\n\ + 向前移动( ( (గంట < 10 ) ? 6 : 10 )/130 * కొలత)\n\ + // if (గంట < 10) {\n\ + // 向前移动(6/130 * కొలత); // horizontal correction to lower left corner\n\ + // } else {\n\ + // 向前移动(10/130 * కొలత)\n\ + // }\n\ + 向右转(180);\n\ + 写(గంట);\n\ + })\n\ + 放下笔刷();\n\ +}\n\ +\n\ +// చేతులు గీయుటకు \n\ +_步骤_ చెయ్యి (థీటా, చెయ్యి_宽度, 长度, 颜色) {\n\ + _此处_ కూచి_తగ్గింపు = 5;\n\ + _此处_ కూచి_తగ్గింపులు = (长度 / కూచి_తగ్గింపు);\n\ + _此处_ 宽度_సర్దుబాటు = చెయ్యి_宽度 / కూచి_తగ్గింపులు;\n\ + 改变位置(0, 0);\n\ + 角度(థీటా);\n\ + 改变颜色为(颜色);\n\ + // for (_到处_ step = 0; step < 长度; step = step + కూచి_తగ్గింపు) \n\ + 计数并重复( కూచి_తగ్గింపులు, ( అడుగు) => \n\ + {\n\ + 宽度( చెయ్యి_宽度 ); // కుంచిక 宽度\n\ + 向前移动(కూచి_తగ్గింపు);\n\ + చెయ్యి_宽度 = చెయ్యి_宽度 - 宽度_సర్దుబాటు;\n\ + }\n\ + );\n\ +}\n\ +\n\ +_步骤_ చేతులు(గంటలు, నిమిషములు, క్షణములు) {\n\ + // క్షణముల చెయ్యి\n\ + _此处_ క్షణముకెన్ని_డిగ్రీలు = 6; // = 360 degrees/60 క్షణములు\n\ + చెయ్యి(క్షణములు * క్షణముకెన్ని_డిగ్రీలు, 4, 100/130 * కొలత, "red");\n\ + // నిమిషముల చెయ్యి \n\ + _此处_ నిమిషానికెన్ని_డిగ్రీలు = 0.1; // = 360 degrees /3600 క్షణములు /గంట\n\ + _此处_ నిమిషములుInక్షణములు = నిమిషములు * 60 + క్షణములు;\n\ + చెయ్యి(నిమిషములుInక్షణములు * నిమిషానికెన్ని_డిగ్రీలు, 10, 100/130 * కొలత, "blue");\n\ + // గంటల చెయ్యి\n\ + _此处_ గంటకెన్ని_డిగ్రీలు = .1/12; // = నిమిషానికెన్ని_డిగ్రీలు / 12 గంటలు \n\ + _此处_ గంటలుInక్షణములు = ((గంటలు % 12) * 3600) + నిమిషములుInక్షణములు;\n\ + చెయ్యి(గంటలుInక్షణములు * గంటకెన్ని_డిగ్రీలు, 10, 60/130 * కొలత, "green");\n\ +}\n\ +\n\ +// 时钟ను పునరావృతము చేయుటకు\n\ +_步骤_ 时钟() {\n\ + 擦除画布();\n\ + కొలత = .9 * Math.min( 最大_X_值(), 最大_Y_值())\n\ + అంకెలు(0, 0, 110/130 * కొలత);\n\ + 改变颜色为("lightgreen");\n\ + 改变位置(0,0);\n\ + 宽度(1/130* కొలత)\n\ + 圆形(130/130 * కొలత );\n\ + క్షణముల_గీతలు(0, 0, 130/130 * కొలత );\n\ + _此处_ సమయము = new Date();\n\ + చేతులు(సమయము.getHours(), సమయము.getMinutes(), సమయము.getSeconds());\n\ +}\n\ +\n\ +_步骤_ 演示() {\n\ + 初始状态();\n\ + 隐藏笔刷();\n\ + 播放(时钟,1000); // 时钟ను ప్రతి క్షణము పునరావృతము చేయ వలెను.\n\ +}\n\ +' +沙畫 ='\ +\n\ +演示 = () => {\n\ + 初始状态();\n\ + 隐藏笔刷();\n\ + 重复(6, () => {\n\ + 改变颜色为( 1 ); // 蓝色 \n\ + 向右转(180);\n\ + _此处_ 边 = 100;\n\ + _此处_ 颜色编号 = 0;\n\ + 当_时重复( () => 边 > 0, ()=> {\n\ + \n\ + 向右弯曲(边, 30 );\n\ + \n\ + 向右转(30);\n\ + 边 = 边 - 10;\n\ + 颜色编号 = ( 颜色编号 + 15 ) % 16;\n\ + 改变颜色为( 颜色编号 );\n\ + } );\n\ + });\n\ +\n\ + 向右转(310);\n\ + 抬起笔刷();\n\ + 向前移动(60 );\n\ + 放下笔刷()\n\ + 改变颜色为( 13 );\n\ + 实心圆(5 );\n\ + 圆形(10);\n\ +}\n\ +' +磚牆 ='\ +// 砖块 ప్రస్తారము \n\ +\n\ +_总是_ 高度 = 15\n\ +_总是_ 宽度 = 2* 高度 \n\ +\n\ +// 砖块 == ఇటుక \n\ +\n\ +砖块 = ( 高度, 宽度, 砖块颜色) => {\n\ + 开始绘制形状()\n\ + 重复 (2, () => {\n\ + 向前移动( 宽度)\n\ + 向右转(90)\n\ + 向前移动( 高度)\n\ + 向右转(90)\n\ + })\n\ + 停止绘制形状( 砖块颜色)\n\ + 向前移动( 宽度)\n\ +}\n\ +\n\ +演示 = () => {\n\ + 初始状态()\n\ + \n\ + yB = 最大_Y_值()\n\ + xB = 最小_X_值()\n\ + 不要添加轮廓()\n\ + 向右转( 90)\n\ + 改变颜色为( 7 ) // 白色\n\ +\n\ + 当_时重复( () => కుంచిక.స్థానము.y > 最小_Y_值(), () => {\n\ + 改变位置(xB, yB)\n\ + 当_时重复( () => కుంచిక.స్థానము.x < 最大_X_值(), () => {\n\ + 放下笔刷()\n\ + 砖块(高度, 宽度, "darkred")\n\ + 抬起笔刷()\n\ + } )\n\ + yB = yB - 高度\n\ +\n\ + 改变位置(xB - 宽度/2, yB)\n\ + 当_时重复( () => కుంచిక.స్థానము.x < 最大_X_值(), () => {\n\ + 放下笔刷()\n\ + 砖块(高度, 宽度, "darkred")\n\ + 抬起笔刷()\n\ + } )\n\ + yB = yB - 高度\n\ + } )\n\ +}\n\ +' +蛋形 ='\ +// 來源: https://pythonturtle.academy/tutorial-drawing-egg-shape-with-python-turtle/\n\ +\n\ +蛋形 = (x, y, 尺寸, 斜率) => {\n\ + 抬起笔刷();\n\ + 改变位置(x, y);\n\ + 放下笔刷();\n\ + 改变方向(270 + 斜率);\n\ + 改变颜色为(4); // 红色\n\ + 向右弯曲(尺寸, 180);\n\ + 改变颜色为(1); // 蓝色\n\ + 向右弯曲(2 * 尺寸, 45);\n\ + 改变颜色为("ఆకుపచ్చ");\n\ + 向右弯曲(0.586 * 尺寸, 90);\n\ + 改变颜色为(1); // 蓝色\n\ + 向右弯曲(2 * 尺寸, 45);\n\ +};\n\ +\n\ +演示 = () => {\n\ + 初始状态();\n\ + 隐藏笔刷();\n\ + 蛋形(90, 90, 40, 0);\n\ + 蛋形(0, 0, 90, 45);\n\ +};\n\ +' +雪花 ='\ +\n\ +\n\ +最小_值 = Math.min\n\ +\n\ +_步骤_ 科赫线 (长度, 深度) {\n\ + 如果_就_否则( () => (深度 == 0),\n\ + () => { 向前移动(长度); },\n\ + () => {\n\ + // ఎడమ వైపు బుడిప \n\ + 科赫线 (长度/3, 深度-1);\n\ + 向左转(60); \n\ + 科赫线 (长度/3, 深度-1);\n\ + 向右转(120); \n\ + 科赫线 (长度/3, 深度-1);\n\ + 向左转(60); \n\ + 科赫线 (长度/3, 深度-1);\n\ + } )\n\ +}\n\ +\n\ +\n\ +_步骤_ 科赫雪花 (长度, 深度) {\n\ + 角度 (30);\n\ + 改变位置(-长度/2,-.3 * 长度);\n\ + 科赫线 (长度, 深度);\n\ + 向右转(120);\n\ + 科赫线 (长度, 深度);\n\ + 向右转(120);\n\ + 科赫线 (长度, 深度);\n\ + 向右转(120);\n\ +}\n\ + \n\ +雪花 = ()=> {\n\ + 花瓣颜色.push(随机数(15) );\n\ + 花瓣颜色.shift();\n\ + 计数并重复 (6, ( క ) => {\n\ + 改变颜色为( 花瓣颜色 [క] );\n\ + 科赫雪花( 长度 * (క+1) * (క+1), క)\n\ + } );\n\ +}\n\ +\n\ +_步骤_ 演示() {\n\ + 初始状态();\n\ + 长度 = .045* 最小_值(最大_X_值(), 最大_Y_值())\n\ + 花瓣颜色 = [];\n\ + 计数并重复 (6, ( క ) => {\n\ + 花瓣颜色[క] = 随机数(6);\n\ + } );\n\ +\n\ + 隐藏笔刷();\n\ + 播放(雪花,1)\n\ +}\n\ +' +正方形 ='\ +/* ఇక్కడ మీ ప్రక్రియ లు వ్రాయ గలరు. ఉదాహరణ కి: */\n\ +\n\ +正方形 = ( 边 ) => {\n\ + 重复(4, () => {\n\ + 向前移动( 边 );\n\ + 向右转(90);\n\ + });\n\ +}\n\ +\n\ +演示 = () => {\n\ + 初始状态();\n\ + 隐藏笔刷();\n\ + 改变颜色为( 1 ); // 蓝色 \n\ + _此处_ 边 = 100;\n\ + _此处_ 颜色编号 = 0;\n\ + 当_时重复( () => 边 > 0, ()=> {\n\ + 正方形( 边 );\n\ + 向右转(36);\n\ + 边 = 边 - 10;\n\ + 颜色编号 = ( 颜色编号 + 1 ) % 16;\n\ + 改变颜色为( 颜色编号 );\n\ + } );\n\ +}\n\ +' +// End Chinese // Begin English square ='\ /* Define helper functions here\n\ @@ -2322,7 +2652,7 @@ _విధానము_ ప్రదర్శన() {\n\ _అత్ర_ రంగు_సంఖ్య = 0;\n\ యావత్_పరిక్రమ( () => భుజము > 0, ()=> {\n\ \n\ - కుడివైపు_చాపాము(భుజము, 30 );\n\ + కుడివైపు_చాపము(భుజము, 30 );\n\ \n\ కుడి_వైపు_తిరుగు(30);\n\ భుజము = భుజము - 10;\n\ @@ -2344,26 +2674,26 @@ _విధానము_ ప్రదర్శన() {\n\ // మూలము: https://pythonturtle.academy/tutorial-drawing-egg-shape-with-python-turtle/\n\ \n\ అండాకారము = (x, y, పరిమాణము, వాలు) => {\n\ - కుంచికను_పైకి_ఎత్తు()\n\ - స్థానము_మార్చు(x,y)\n\ - కుంచికను_కింద_పెట్టు()\n\ - దిశ_మార్చు(270+వాలు)\n\ - రంగు_మార్చు(ఎరుపు)\n\ - కుడివైపు_చాపాము(పరిమాణము,180)\n\ - రంగు_మార్చు(నీలము)\n\ - కుడివైపు_చాపాము(2*పరిమాణము,45)\n\ - రంగు_మార్చు("ఆకుపచ్చ")\n\ - కుడివైపు_చాపాము(0.586*పరిమాణము,90)\n\ - రంగు_మార్చు(నీలము)\n\ - కుడివైపు_చాపాము(2*పరిమాణము,45)\n\ -}\n\ + కుంచికను_పైకి_ఎత్తు();\n\ + స్థానము_మార్చు(x, y);\n\ + కుంచికను_కింద_పెట్టు();\n\ + దిశ_మార్చు(270 + వాలు);\n\ + రంగు_మార్చు(ఎరుపు);\n\ + కుడివైపు_చాపము(పరిమాణము, 180);\n\ + రంగు_మార్చు(నీలము);\n\ + కుడివైపు_చాపము(2 * పరిమాణము, 45);\n\ + రంగు_మార్చు("ఆకుపచ్చ");\n\ + కుడివైపు_చాపము(0.586 * పరిమాణము, 90);\n\ + రంగు_మార్చు(నీలము);\n\ + కుడివైపు_చాపము(2 * పరిమాణము, 45);\n\ +};\n\ \n\ ప్రదర్శన = () => {\n\ ఆది_స్థితి();\n\ కుంచికను_దాచు();\n\ - అండాకారము( 90, 90, 40, 0 )\n\ - అండాకారము( 0, 0, 90, 45 )\n\ -}\n\ + అండాకారము(90, 90, 40, 0);\n\ + అండాకారము(0, 0, 90, 45);\n\ +};\n\ ' హిమరేకులు ='\ \n\ diff --git "a/examples/Chinese/\346\227\266\351\222\237.js" "b/examples/Chinese/\346\227\266\351\222\237.js" new file mode 100644 index 00000000..75afc71f --- /dev/null +++ "b/examples/Chinese/\346\227\266\351\222\237.js" @@ -0,0 +1,102 @@ +// గోడ 时钟 + +_到处_ కొలత; + +// 时钟 చుట్టూ క్షణముల గీతలు గీయుటకు +_步骤_ క్షణముల_గీతలు(x, y, వ్యాసార్థము) { + _此处_ గీత_长度 = 7; + _此处_ ఖాళీ = వ్యాసార్థము - గీత_长度; + 改变颜色为( 1 ); // 蓝色 + 宽度(1); + 计数并重复( 60, ( కో ) => { + _此处_ థీటా = కో * 6; + // ప్రతి ఐదవది దళసరి గా వేయవలెను + 宽度( ( ( కో % 5 ) ? 1 : 3)/130* కొలత) + 抬起笔刷(); + 改变位置(0,0); + 角度(థీటా); + 向前移动(ఖాళీ); + 放下笔刷(); + 向前移动(గీత_长度); + }); + +} + + +// గంటలు, నిమిషాలూ సూచించే అంకెలు +_步骤_ అంకెలు(x, y, వ్యాసార్థము) { + 抬起笔刷(); + _此处_ అక్షర_尺寸 = 20/130 * కొలత + 设置字体(అక్షర_尺寸+"px sans-serif"); + 改变颜色为("నలుపు"); + 计数并重复( 12, ( గంట ) =>{ + 改变位置(x,y); + 角度(గంట * 30); + 向前移动(వ్యాసార్థము); // to center of digit + 角度(180); + 向前移动(10/130 * కొలత); // vertical correction to baseline + 向右转(90); + // క్రింది, ఎడమ భాగమునకు అనుప్రస్థ సరదుబాటు + 向前移动( ( (గంట < 10 ) ? 6 : 10 )/130 * కొలత) + // if (గంట < 10) { + // 向前移动(6/130 * కొలత); // horizontal correction to lower left corner + // } else { + // 向前移动(10/130 * కొలత) + // } + 向右转(180); + 写(గంట); + }) + 放下笔刷(); +} + +// చేతులు గీయుటకు +_步骤_ చెయ్యి (థీటా, చెయ్యి_宽度, 长度, 颜色) { + _此处_ కూచి_తగ్గింపు = 5; + _此处_ కూచి_తగ్గింపులు = (长度 / కూచి_తగ్గింపు); + _此处_ 宽度_సర్దుబాటు = చెయ్యి_宽度 / కూచి_తగ్గింపులు; + 改变位置(0, 0); + 角度(థీటా); + 改变颜色为(颜色); + // for (_到处_ step = 0; step < 长度; step = step + కూచి_తగ్గింపు) + 计数并重复( కూచి_తగ్గింపులు, ( అడుగు) => + { + 宽度( చెయ్యి_宽度 ); // కుంచిక 宽度 + 向前移动(కూచి_తగ్గింపు); + చెయ్యి_宽度 = చెయ్యి_宽度 - 宽度_సర్దుబాటు; + } + ); +} + +_步骤_ చేతులు(గంటలు, నిమిషములు, క్షణములు) { + // క్షణముల చెయ్యి + _此处_ క్షణముకెన్ని_డిగ్రీలు = 6; // = 360 degrees/60 క్షణములు + చెయ్యి(క్షణములు * క్షణముకెన్ని_డిగ్రీలు, 4, 100/130 * కొలత, "red"); + // నిమిషముల చెయ్యి + _此处_ నిమిషానికెన్ని_డిగ్రీలు = 0.1; // = 360 degrees /3600 క్షణములు /గంట + _此处_ నిమిషములుInక్షణములు = నిమిషములు * 60 + క్షణములు; + చెయ్యి(నిమిషములుInక్షణములు * నిమిషానికెన్ని_డిగ్రీలు, 10, 100/130 * కొలత, "blue"); + // గంటల చెయ్యి + _此处_ గంటకెన్ని_డిగ్రీలు = .1/12; // = నిమిషానికెన్ని_డిగ్రీలు / 12 గంటలు + _此处_ గంటలుInక్షణములు = ((గంటలు % 12) * 3600) + నిమిషములుInక్షణములు; + చెయ్యి(గంటలుInక్షణములు * గంటకెన్ని_డిగ్రీలు, 10, 60/130 * కొలత, "green"); +} + +// 时钟ను పునరావృతము చేయుటకు +_步骤_ 时钟() { + 擦除画布(); + కొలత = .9 * Math.min( 最大_X_值(), 最大_Y_值()) + అంకెలు(0, 0, 110/130 * కొలత); + 改变颜色为("lightgreen"); + 改变位置(0,0); + 宽度(1/130* కొలత) + 圆形(130/130 * కొలత ); + క్షణముల_గీతలు(0, 0, 130/130 * కొలత ); + _此处_ సమయము = new Date(); + చేతులు(సమయము.getHours(), సమయము.getMinutes(), సమయము.getSeconds()); +} + +_步骤_ 演示() { + 初始状态(); + 隐藏笔刷(); + 播放(时钟,1000); // 时钟ను ప్రతి క్షణము పునరావృతము చేయ వలెను. +} diff --git "a/examples/Chinese/\346\255\243\346\226\271\345\275\242.js" "b/examples/Chinese/\346\255\243\346\226\271\345\275\242.js" new file mode 100644 index 00000000..ba9ae703 --- /dev/null +++ "b/examples/Chinese/\346\255\243\346\226\271\345\275\242.js" @@ -0,0 +1,23 @@ +/* ఇక్కడ మీ ప్రక్రియ లు వ్రాయ గలరు. ఉదాహరణ కి: */ + +正方形 = ( 边 ) => { + 重复(4, () => { + 向前移动( 边 ); + 向右转(90); + }); +} + +演示 = () => { + 初始状态(); + 隐藏笔刷(); + 改变颜色为( 1 ); // 蓝色 + _此处_ 边 = 100; + _此处_ 颜色编号 = 0; + 当_时重复( () => 边 > 0, ()=> { + 正方形( 边 ); + 向右转(36); + 边 = 边 - 10; + 颜色编号 = ( 颜色编号 + 1 ) % 16; + 改变颜色为( 颜色编号 ); + } ); +} diff --git "a/examples/Chinese/\346\262\231\347\225\253.js" "b/examples/Chinese/\346\262\231\347\225\253.js" new file mode 100644 index 00000000..7c5e3ca0 --- /dev/null +++ "b/examples/Chinese/\346\262\231\347\225\253.js" @@ -0,0 +1,28 @@ + +演示 = () => { + 初始状态(); + 隐藏笔刷(); + 重复(6, () => { + 改变颜色为( 1 ); // 蓝色 + 向右转(180); + _此处_ 边 = 100; + _此处_ 颜色编号 = 0; + 当_时重复( () => 边 > 0, ()=> { + + 向右弯曲(边, 30 ); + + 向右转(30); + 边 = 边 - 10; + 颜色编号 = ( 颜色编号 + 15 ) % 16; + 改变颜色为( 颜色编号 ); + } ); + }); + + 向右转(310); + 抬起笔刷(); + 向前移动(60 ); + 放下笔刷() + 改变颜色为( 13 ); + 实心圆(5 ); + 圆形(10); +} diff --git "a/examples/Chinese/\347\243\232\347\211\206.js" "b/examples/Chinese/\347\243\232\347\211\206.js" new file mode 100644 index 00000000..dc13e3c4 --- /dev/null +++ "b/examples/Chinese/\347\243\232\347\211\206.js" @@ -0,0 +1,46 @@ +// 砖块 ప్రస్తారము + +_总是_ 高度 = 15 +_总是_ 宽度 = 2* 高度 + +// 砖块 == ఇటుక + +砖块 = ( 高度, 宽度, 砖块颜色) => { + 开始绘制形状() + 重复 (2, () => { + 向前移动( 宽度) + 向右转(90) + 向前移动( 高度) + 向右转(90) + }) + 停止绘制形状( 砖块颜色) + 向前移动( 宽度) +} + +演示 = () => { + 初始状态() + + yB = 最大_Y_值() + xB = 最小_X_值() + 不要添加轮廓() + 向右转( 90) + 改变颜色为( 7 ) // 白色 + + 当_时重复( () => కుంచిక.స్థానము.y > 最小_Y_值(), () => { + 改变位置(xB, yB) + 当_时重复( () => కుంచిక.స్థానము.x < 最大_X_值(), () => { + 放下笔刷() + 砖块(高度, 宽度, "darkred") + 抬起笔刷() + } ) + yB = yB - 高度 + + 改变位置(xB - 宽度/2, yB) + 当_时重复( () => కుంచిక.స్థానము.x < 最大_X_值(), () => { + 放下笔刷() + 砖块(高度, 宽度, "darkred") + 抬起笔刷() + } ) + yB = yB - 高度 + } ) +} diff --git "a/examples/Chinese/\350\233\213\345\275\242.js" "b/examples/Chinese/\350\233\213\345\275\242.js" new file mode 100644 index 00000000..3071b66a --- /dev/null +++ "b/examples/Chinese/\350\233\213\345\275\242.js" @@ -0,0 +1,23 @@ +// 來源: https://pythonturtle.academy/tutorial-drawing-egg-shape-with-python-turtle/ + +蛋形 = (x, y, 尺寸, 斜率) => { + 抬起笔刷(); + 改变位置(x, y); + 放下笔刷(); + 改变方向(270 + 斜率); + 改变颜色为(4); // 红色 + 向右弯曲(尺寸, 180); + 改变颜色为(1); // 蓝色 + 向右弯曲(2 * 尺寸, 45); + 改变颜色为("ఆకుపచ్చ"); + 向右弯曲(0.586 * 尺寸, 90); + 改变颜色为(1); // 蓝色 + 向右弯曲(2 * 尺寸, 45); +}; + +演示 = () => { + 初始状态(); + 隐藏笔刷(); + 蛋形(90, 90, 40, 0); + 蛋形(0, 0, 90, 45); +}; diff --git "a/examples/Chinese/\351\233\252\350\212\261.js" "b/examples/Chinese/\351\233\252\350\212\261.js" new file mode 100644 index 00000000..a7b371cb --- /dev/null +++ "b/examples/Chinese/\351\233\252\350\212\261.js" @@ -0,0 +1,51 @@ + + +最小_值 = Math.min + +_步骤_ 科赫线 (长度, 深度) { + 如果_就_否则( () => (深度 == 0), + () => { 向前移动(长度); }, + () => { + // ఎడమ వైపు బుడిప + 科赫线 (长度/3, 深度-1); + 向左转(60); + 科赫线 (长度/3, 深度-1); + 向右转(120); + 科赫线 (长度/3, 深度-1); + 向左转(60); + 科赫线 (长度/3, 深度-1); + } ) +} + + +_步骤_ 科赫雪花 (长度, 深度) { + 角度 (30); + 改变位置(-长度/2,-.3 * 长度); + 科赫线 (长度, 深度); + 向右转(120); + 科赫线 (长度, 深度); + 向右转(120); + 科赫线 (长度, 深度); + 向右转(120); +} + +雪花 = ()=> { + 花瓣颜色.push(随机数(15) ); + 花瓣颜色.shift(); + 计数并重复 (6, ( క ) => { + 改变颜色为( 花瓣颜色 [క] ); + 科赫雪花( 长度 * (క+1) * (క+1), క) + } ); +} + +_步骤_ 演示() { + 初始状态(); + 长度 = .045* 最小_值(最大_X_值(), 最大_Y_值()) + 花瓣颜色 = []; + 计数并重复 (6, ( క ) => { + 花瓣颜色[క] = 随机数(6); + } ); + + 隐藏笔刷(); + 播放(雪花,1) +} diff --git "a/examples/Chinese/\351\261\274.js" "b/examples/Chinese/\351\261\274.js" new file mode 100644 index 00000000..534c1338 --- /dev/null +++ "b/examples/Chinese/\351\261\274.js" @@ -0,0 +1,41 @@ +平方根 = Math.sqrt; + +演示 = () => { + 初始状态(); + 隐藏笔刷(); + + 鱼 = (వ) => { + 圆形(వ); + 向右转(90); + + 抬起笔刷(); + 向前移动(వ); + 放下笔刷(); + + 显示笔刷(); + + 向左转(45); + 向前移动(2 * వ); + 向右转(90 + 45); + + 向前移动(平方根(2 * వ * 2 * వ * 2)); + + 向右转(90 + 45); + 向前移动(2 * వ); + 向左转(45); + + // 隐藏笔刷(); + + 抬起笔刷(); + 向前移动(వ); + 放下笔刷(); + + 向右转(90); + }; + + 颜色_鱼 = (颜色编号) => { + 改变颜色为(颜色编号); + 鱼(40 + 颜色编号 * 1); + }; + 计数并重复(16, (క) => 颜色_鱼(క)); +}; diff --git "a/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\205\340\260\202\340\260\241\340\260\276\340\260\225\340\260\276\340\260\260\340\260\256\340\261\201.js" "b/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\205\340\260\202\340\260\241\340\260\276\340\260\225\340\260\276\340\260\260\340\260\256\340\261\201.js" index c0fee295..cd364a58 100644 --- "a/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\205\340\260\202\340\260\241\340\260\276\340\260\225\340\260\276\340\260\260\340\260\256\340\261\201.js" +++ "b/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\205\340\260\202\340\260\241\340\260\276\340\260\225\340\260\276\340\260\260\340\260\256\340\261\201.js" @@ -1,23 +1,23 @@ // మూలము: https://pythonturtle.academy/tutorial-drawing-egg-shape-with-python-turtle/ అండాకారము = (x, y, పరిమాణము, వాలు) => { - కుంచికను_పైకి_ఎత్తు() - స్థానము_మార్చు(x,y) - కుంచికను_కింద_పెట్టు() - దిశ_మార్చు(270+వాలు) - రంగు_మార్చు(ఎరుపు) - కుడివైపు_చాపాము(పరిమాణము,180) - రంగు_మార్చు(నీలము) - కుడివైపు_చాపాము(2*పరిమాణము,45) - రంగు_మార్చు("ఆకుపచ్చ") - కుడివైపు_చాపాము(0.586*పరిమాణము,90) - రంగు_మార్చు(నీలము) - కుడివైపు_చాపాము(2*పరిమాణము,45) -} + కుంచికను_పైకి_ఎత్తు(); + స్థానము_మార్చు(x, y); + కుంచికను_కింద_పెట్టు(); + దిశ_మార్చు(270 + వాలు); + రంగు_మార్చు(ఎరుపు); + కుడివైపు_చాపము(పరిమాణము, 180); + రంగు_మార్చు(నీలము); + కుడివైపు_చాపము(2 * పరిమాణము, 45); + రంగు_మార్చు("ఆకుపచ్చ"); + కుడివైపు_చాపము(0.586 * పరిమాణము, 90); + రంగు_మార్చు(నీలము); + కుడివైపు_చాపము(2 * పరిమాణము, 45); +}; ప్రదర్శన = () => { ఆది_స్థితి(); కుంచికను_దాచు(); - అండాకారము( 90, 90, 40, 0 ) - అండాకారము( 0, 0, 90, 45 ) -} + అండాకారము(90, 90, 40, 0); + అండాకారము(0, 0, 90, 45); +}; diff --git "a/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\260\340\260\202\340\260\227\340\260\265\340\260\262\340\261\215\340\260\262\340\261\200.js" "b/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\260\340\260\202\340\260\227\340\260\265\340\260\262\340\261\215\340\260\262\340\261\200.js" index 58f59d4f..8549252f 100644 --- "a/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\260\340\260\202\340\260\227\340\260\265\340\260\262\340\261\215\340\260\262\340\261\200.js" +++ "b/examples/\340\260\244\340\261\206\340\260\262\340\261\201\340\260\227\340\261\201/\340\260\260\340\260\202\340\260\227\340\260\265\340\260\262\340\261\215\340\260\262\340\261\200.js" @@ -9,7 +9,7 @@ _అత్ర_ రంగు_సంఖ్య = 0; యావత్_పరిక్రమ( () => భుజము > 0, ()=> { - కుడివైపు_చాపాము(భుజము, 30 ); + కుడివైపు_చాపము(భుజము, 30 ); కుడి_వైపు_తిరుగు(30); భుజము = భుజము - 10; diff --git a/index.html b/index.html index 327e2115..ea6e6d1d 100644 --- a/index.html +++ b/index.html @@ -296,7 +296,7 @@