This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <canvas id="canvas" width="298" height="400"></canvas> | |
| <footer> | |
| <button type="button" id="play" class="button">Play</button> | |
| </footer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This line declares a function called main(). Functions are a | |
| block of statements that the computer executes when the function is “called.” main() is always the entry point of a Dart program—the place where the | |
| program begins execution. main() is automatically called (executed). The void indicates that the main() function will not return any value. The opening curly brace indicates where the function starts. The empty parentheses mean that this function takes no arguments. | |
| The main() function has only one statement. This statement calls a function built into Dart named “print,” which will print out any line of text to the console. A piece of text is known as a string, and in its literal form is contained within quotes. So, this function, print(), takes one argument, a string literal, and prints it out to the console. The semicolon at the end of the line indicates where | |
| the statement ends. | |
| */ | |
| void main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="output"> | |
| <label for="todo">What do you want todo?</label> | |
| <input type="text" id="todo" placeholder="Enter a Todo." /> | |
| <button id="clear">Clear All Todos</button> | |
| <div id="todo-list"> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 猜一個 1 ~ 100 間的整數:<br /> | |
| <input type="text" id="input" /> | |
| <input type="submit" id="submit" value="猜數字"/> | |
| <div id="output"></div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <canvas id="canvas" width="300" height="300"></canvas> | |
| <div id="output"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div> | |
| <canvas id="draw-surface" width="800px" height="600px"> | |
| </canvas> | |
| </div> | |
| <div id="colors"> | |
| <input id="white" type="button"></input> | |
| <input id="red" type="button"></input> | |
| <input id="black" type="button"></input> | |
| <input id="blue" type="button"></input> | |
| <input id="green" type="button"></input> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://mde.tw/2017springcd/blog/brython-2d-canvas-fourbar.html | |
| # http://project.mde.tw/blog/pyslvs_triangle_expression.html | |
| # http://lab.kmol.info/2017fall/blog/kmol-2017-fall-cadp-fourbar-three-position-synthesis.html | |
| from browser import document | |
| import math | |
| import time | |
| from browser import timer | |
| class Coord(object): | |
| def __init__(self,x,y): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 算出大略相等數目的分組數列 | |
| void main() { | |
| // total student number | |
| int total = 52; | |
| // initial each group expect to be "eachGrp" number of people | |
| int eachGrp = 10; | |
| // may divide into "grpNum" number of group | |
| int grpNum = total ~/ eachGrp; | |
| // vacant list | |
| var splits = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:html'; | |
| void main() { | |
| // 每一組 10 人 | |
| int num = 10; | |
| // 組序由 1 開始 | |
| int gth = 1; | |
| // 迴圈序號變數 | |
| int i; | |
| // 每組學員暫存數列 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:html'; | |
| void main() { | |
| // 每一組 10 人 | |
| int num = 10; | |
| // 組序由 1 開始 | |
| int gth = 1; | |
| // 迴圈序號變數 | |
| int i; | |
| // 每組學員暫存數列 |