Hello world com blockly-games
8
caddy/etc/Caddyfile
Normal file
@@ -0,0 +1,8 @@
|
||||
http://blockly.localhost {
|
||||
root /var/www/html/blockly-games/
|
||||
file_server
|
||||
}
|
||||
|
||||
http://moodle.localhost {
|
||||
reverse_proxy moodle:8000
|
||||
}
|
||||
@@ -1,4 +1,16 @@
|
||||
services:
|
||||
static_sites:
|
||||
image: caddy:alpine
|
||||
container_name: static_sites_caddy
|
||||
restart: always
|
||||
volumes:
|
||||
- ./html:/var/www/html
|
||||
- ./caddy/etc/Caddyfile:/etc/caddy/Caddyfile
|
||||
ports:
|
||||
- "80:80"
|
||||
expose:
|
||||
- 80
|
||||
|
||||
moodle_db:
|
||||
image: mariadb:10
|
||||
container_name: moodle_db
|
||||
@@ -12,7 +24,7 @@ services:
|
||||
moodle:
|
||||
image: moodlehq/moodleapp:latest
|
||||
ports:
|
||||
- "80:443"
|
||||
- "8000:80"
|
||||
expose:
|
||||
- 443
|
||||
environment:
|
||||
|
||||
134
html/blockly-games/about.html
Normal file
@@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>About Blockly Games</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<style>
|
||||
body {
|
||||
padding: 1em 8em;
|
||||
}
|
||||
td {
|
||||
padding: 0 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a id="back" href="/">Blockly Games</a> : About</h1>
|
||||
|
||||
<p>Blockly Games is a series of educational games that teach programming. It is
|
||||
designed for children who have not had prior experience with computer programming.
|
||||
By the end of these games, players are ready to use conventional text-based languages.</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/puzzle.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Puzzle is a quick introduction to Blockly's shapes and how the pieces snap together.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/maze.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Maze is an introduction to loops and conditionals. It starts simply, but
|
||||
every level is more challenging than the last.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/bird.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Bird is a deep-dive into conditionals. Control-flow is explored with
|
||||
increasingly complex conditions.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/turtle.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Turtle is a deep-dive into loops. Use nested loops to paint a picture.
|
||||
Then publish your art for the world to see.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/movie.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Movie is an introduction to mathematical equations. Use math to animate a movie.
|
||||
Then publish your movie for the world to watch.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/music.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Music is an introduction to functions. Use functions to compose music.
|
||||
Then publish your music for the world to listen to.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/pond-tutor.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Pond Tutor introduces text-based programming. Levels switch back and forth
|
||||
between blocks and actual JavaScript in a text editor.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img src="index/pond-duck.png" height=100 width=100>
|
||||
</td>
|
||||
<td>
|
||||
<p>Pond is an open-ended contest to program the smartest duck.
|
||||
Use either blocks or JavaScript.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>Blockly Games is a Google project to encourage tomorrow's programmers. The
|
||||
games are designed to be self-paced and self-teaching. Feel free to use Blockly
|
||||
Games both inside and outside the classroom. All code is open source, see
|
||||
the <a href="https://github.com/google/blockly-games/wiki">developer's website</a>
|
||||
for more info or to download zip files for offline use.</p>
|
||||
|
||||
<p>Developers, teachers and parents are welcome to
|
||||
<a href="https://groups.google.com/forum/#!forum/blockly-games">give feedback</a>
|
||||
as we continue to grow.</p>
|
||||
|
||||
<p style="text-align: center; font-size: small">
|
||||
<a href="https://policies.google.com/privacy">Google Privacy Policy</a> —
|
||||
<a href="https://policies.google.com/terms">Google Terms of Service</a>
|
||||
</p>
|
||||
|
||||
<script src="common/back.js"></script>
|
||||
<!-- Google Analytics -->
|
||||
<script>
|
||||
if (window.location.pathname.substr(-5) != '.html'){
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-50448074-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
</script>
|
||||
<!-- End Google Analytics -->
|
||||
</body>
|
||||
</html>
|
||||
15
html/blockly-games/bird.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Bird</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="bird/style.css">
|
||||
<script src="common/boot.js"></script>
|
||||
<script src="/common/storage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/bird/birds-120.png
Normal file
|
After Width: | Height: | Size: 327 KiB |
702
html/blockly-games/bird/generated/pt-br/compressed.js
Normal file
BIN
html/blockly-games/bird/help_heading.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
html/blockly-games/bird/help_mutator.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
html/blockly-games/bird/help_up.png
Normal file
|
After Width: | Height: | Size: 544 B |
BIN
html/blockly-games/bird/icons.png
Normal file
|
After Width: | Height: | Size: 511 B |
BIN
html/blockly-games/bird/nest.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
html/blockly-games/bird/quack.mp3
Normal file
BIN
html/blockly-games/bird/quack.ogg
Normal file
54
html/blockly-games/bird/style.css
Normal file
@@ -0,0 +1,54 @@
|
||||
#blockly {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
}
|
||||
#visualization {
|
||||
position: relative;
|
||||
}
|
||||
.edges, .edgeX, .edgeY {
|
||||
stroke-width: 1;
|
||||
stroke: #BBA;
|
||||
fill: none;
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
font-weight: 100;
|
||||
}
|
||||
.edgeX {
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
#svgBird {
|
||||
overflow: hidden;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
img[src$="help_up.png"] {
|
||||
margin: -20px 10px 0;
|
||||
height: 64px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
button.primary {
|
||||
/* Can't use "text-align: start" due to IE. */
|
||||
text-align: left;
|
||||
}
|
||||
html[dir="RTL"] button.primary {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Sprited icons. */
|
||||
.icon21 {
|
||||
height: 21px;
|
||||
width: 21px;
|
||||
background-image: url(icons.png);
|
||||
}
|
||||
.link {
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
.run {
|
||||
background-position: 0px -21px;
|
||||
}
|
||||
.stop {
|
||||
background-position: -21px -21px;
|
||||
}
|
||||
BIN
html/blockly-games/bird/whack.mp3
Normal file
BIN
html/blockly-games/bird/whack.ogg
Normal file
BIN
html/blockly-games/bird/worm.mp3
Normal file
BIN
html/blockly-games/bird/worm.ogg
Normal file
BIN
html/blockly-games/bird/worm.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
html/blockly-games/common/1x1.gif
Normal file
|
After Width: | Height: | Size: 43 B |
30
html/blockly-games/common/back.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2014 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview JavaScript for correctly linking the title link.
|
||||
* @author fraser@google.com (Neil Fraser)
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
// Change the 'Blockly Games' link when served as raw HTML files.
|
||||
// Append the language.
|
||||
var IS_HTML = !!window.location.pathname.match(/\.html$/);
|
||||
document.getElementById('back').href =
|
||||
(IS_HTML ? 'index.html' : '/') + location.search;
|
||||
})();
|
||||
18
html/blockly-games/common/boot.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
// Single-language bootloader.
|
||||
(function() {
|
||||
// Application path.
|
||||
var appName = location.pathname.match(/\/([-\w]+)(\.html)?$/);
|
||||
appName = appName ? appName[1].replace('-', '/') : 'index';
|
||||
|
||||
// Only one language.
|
||||
var lang = 'pt-br';
|
||||
window['BlocklyGamesLanguages'] = [lang];
|
||||
window['BlocklyGamesLang'] = lang;
|
||||
|
||||
// Load the language pack.
|
||||
var script = document.createElement('script');
|
||||
script.src = appName + '/generated/' + lang + '/compressed.js';
|
||||
script.type = 'text/javascript';
|
||||
document.head.appendChild(script);
|
||||
})();
|
||||
167
html/blockly-games/common/common.css
Normal file
@@ -0,0 +1,167 @@
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
margin-top: 0;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 130%;
|
||||
}
|
||||
h1 a {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: #f00;
|
||||
}
|
||||
.farSide {
|
||||
text-align: right;
|
||||
}
|
||||
html[dir="RTL"] .farSide {
|
||||
text-align: left;
|
||||
}
|
||||
.level_number {
|
||||
border: solid 1px #ddd;
|
||||
border-radius: 20px;
|
||||
padding: 6px 12px;
|
||||
color: #888;
|
||||
}
|
||||
.level_dot {
|
||||
border: solid 1px #ddd;
|
||||
border-radius: 50%;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
display: inline-block;
|
||||
}
|
||||
.level_done, .level_dot:hover, .level_number:hover {
|
||||
background-color: #ddd;
|
||||
color: #000;
|
||||
}
|
||||
#containerCode {
|
||||
direction: ltr;
|
||||
background-color: #eee;
|
||||
padding: 5px;
|
||||
margin: 0 3ex;
|
||||
font-size: large;
|
||||
overflow: auto;
|
||||
max-height: 200px;
|
||||
}
|
||||
|
||||
img[src$="help.png"] {
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
html[dir="RTL"] .mirrorImg {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
#languageMenu {
|
||||
vertical-align: top;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
button {
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ddd;
|
||||
font-size: large;
|
||||
background-color: #eee;
|
||||
color: #000;
|
||||
}
|
||||
button.primary {
|
||||
border: 1px solid #dd4b39;
|
||||
background-color: #dd4b39;
|
||||
color: #fff;
|
||||
}
|
||||
button.secondary {
|
||||
border: 1px solid #4d90fe;
|
||||
background-color: #4d90fe;
|
||||
color: #fff;
|
||||
}
|
||||
button.primary>img,
|
||||
button.secondary>img {
|
||||
opacity: 1;
|
||||
}
|
||||
button>img {
|
||||
opacity: 0.6;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
button:hover:not(:disabled)>img {
|
||||
opacity: 1;
|
||||
}
|
||||
button:active:not(:disabled) {
|
||||
border: 1px solid #888 !important;
|
||||
}
|
||||
button:hover:not(:disabled) {
|
||||
box-shadow: 2px 2px 5px #888;
|
||||
}
|
||||
|
||||
/* Dialogs */
|
||||
#dialog {
|
||||
visibility: hidden;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #ccc;
|
||||
position: absolute;
|
||||
border-radius: 8px;
|
||||
box-shadow: 5px 5px 5px #888;
|
||||
padding: 10px;
|
||||
}
|
||||
#dialogBorder {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #000;
|
||||
border-radius: 6px;
|
||||
box-shadow: 5px 5px 5px #888;
|
||||
}
|
||||
#dialogShadow {
|
||||
visibility: hidden;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #000;
|
||||
opacity: 0.3
|
||||
}
|
||||
.dialogAnimate {
|
||||
transition-property: width height left top opacity;
|
||||
transition-duration: 0.2s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
.dialogHiddenContent {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
#dialogHeader {
|
||||
height: 25px;
|
||||
margin: -10px -10px 15px;
|
||||
border-top-left-radius: 8px;
|
||||
border-top-right-radius: 8px;
|
||||
background-color: #ddd;
|
||||
cursor: move;
|
||||
}
|
||||
#dialog button {
|
||||
min-width: 4em;
|
||||
}
|
||||
.readonly .blocklyMainBackground {
|
||||
stroke: none;
|
||||
}
|
||||
#galleryForm>header {
|
||||
font-size: larger;
|
||||
}
|
||||
#galleryForm>footer {
|
||||
font-size: smaller;
|
||||
}
|
||||
#galleryForm>* {
|
||||
margin-top: 1em;
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
BIN
html/blockly-games/common/help.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
html/blockly-games/common/loading.gif
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
1
html/blockly-games/common/prettify.css
Normal file
@@ -0,0 +1 @@
|
||||
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
||||
30
html/blockly-games/common/prettify.js
Normal file
@@ -0,0 +1,30 @@
|
||||
!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||
(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a=
|
||||
b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a<f;++a){var h=b[a];if(/\\[bdsw]/i.test(h))c.push(h);else{var h=d(h),l;a+2<f&&"-"===b[a+1]?(l=d(b[a+2]),a+=2):l=h;e.push([h,l]);l<65||h>122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;a<e.length;++a)h=e[a],h[0]<=f[1]+1?f[1]=Math.max(f[1],h[1]):b.push(f=h);for(a=0;a<b.length;++a)h=b[a],c.push(g(h[0])),
|
||||
h[1]>h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f<c;++f){var l=a[f];l==="("?++h:"\\"===l.charAt(0)&&(l=+l.substring(1))&&(l<=h?d[l]=-1:a[f]=g(l))}for(f=1;f<d.length;++f)-1===d[f]&&(d[f]=++x);for(h=f=0;f<c;++f)l=a[f],l==="("?(++h,d[h]||(a[f]="(?:")):"\\"===l.charAt(0)&&(l=+l.substring(1))&&l<=h&&
|
||||
(a[f]="\\"+d[l]);for(f=0;f<c;++f)"^"===a[f]&&"^"!==a[f+1]&&(a[f]="");if(e.ignoreCase&&m)for(f=0;f<c;++f)l=a[f],e=l.charAt(0),l.length>=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k<c;++k){var i=a[k];if(i.ignoreCase)j=!0;else if(/[a-z]/i.test(i.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){m=!0;j=!1;break}}for(var r={b:8,t:9,n:10,v:11,
|
||||
f:12,r:13},n=[],k=0,c=a.length;k<c;++k){i=a[k];if(i.global||i.multiline)throw Error(""+i);n.push("(?:"+s(i)+")")}return RegExp(n.join("|"),j?"gi":"g")}function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)g(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)s[j]="\n",m[j<<1]=x++,m[j++<<1|1]=a}}else if(c==3||c==4)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[\t\n\r ]+/g," "),s[j]=c,m[j<<1]=x,x+=c.length,m[j++<<1|1]=
|
||||
a)}var b=/(?:^|\s)nocode(?:\s|$)/,s=[],x=0,m=[],j=0;g(a);return{a:s.join("").replace(/\n$/,""),d:m}}function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g.nodeType,d=b===1?d?a:g:b===3?V.test(g.nodeValue)?a:d:d;return d===a?void 0:d}function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(s)||[],r={},n=0,e=i.length;n<e;++n){var z=i[n],w=r[z],t=void 0,f;if(typeof w==="string")f=!1;else{var h=b[z.charAt(0)];
|
||||
if(h)t=z.match(h[1]),w=h[0];else{for(f=0;f<x;++f)if(h=d[f],t=z.match(h[1])){w=h[0];break}t||(w="pln")}if((f=w.length>=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c<i;++c){var r=
|
||||
g[c],n=r[3];if(n)for(var e=n.length;--e>=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
||||
q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com",
|
||||
/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+
|
||||
s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,
|
||||
q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d=
|
||||
c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i<c.length;++i)b(c[i]);d===(d|0)&&c[0].setAttribute("value",d);var r=j.createElement("ol");
|
||||
r.className="linenums";for(var d=Math.max(0,d-1|0)||0,i=0,n=c.length;i<n;++i)k=c[i],k.className="L"+(i+d)%10,k.firstChild||k.appendChild(j.createTextNode("\u00a0")),r.appendChild(k);a.appendChild(r)}function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";return F[a]}function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
|
||||
a.a=b;a.d=g.d;a.e=0;I(d,b)(a);var s=/\bMSIE\s(\d+)/.exec(navigator.userAgent),s=s&&+s[1]<=8,d=/\n/g,x=a.a,m=x.length,g=0,j=a.d,k=j.length,b=0,c=a.g,i=c.length,r=0;c[i]=m;var n,e;for(e=n=0;e<i;)c[e]!==c[e+2]?(c[n++]=c[e++],c[n++]=c[e++]):e+=2;i=n;for(e=n=0;e<i;){for(var p=c[e],w=c[e+1],t=e+2;t+2<=i&&c[t+1]===w;)t+=2;c[n++]=p;c[n++]=w;e=t}c.length=n;var f=a.c,h;if(f)h=f.style.display,f.style.display="none";try{for(;b<k;){var l=j[b+2]||m,B=c[r+2]||m,t=Math.min(l,B),A=j[b+1],G;if(A.nodeType!==1&&(G=x.substring(g,
|
||||
t))){s&&(G=G.replace(d,"\r"));A.nodeValue=G;var L=A.ownerDocument,o=L.createElement("span");o.className=c[r+1];var v=A.parentNode;v.replaceChild(o,A);o.appendChild(A);g<l&&(j[b+1]=A=L.createTextNode(x.substring(t,l)),v.insertBefore(A,o.nextSibling))}g=t;g>=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
||||
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],
|
||||
O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
||||
Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
|
||||
V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
|
||||
/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
|
||||
["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}),
|
||||
["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q,
|
||||
hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);
|
||||
p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1});
|
||||
return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i<p.length&&c.now()<b;i++){for(var d=p[i],j=h,k=d;k=k.previousSibling;){var m=k.nodeType,o=(m===7||m===8)&&k.nodeValue;if(o?!/^\??prettify\b/.test(o):m!==3||/\S/.test(k.nodeValue))break;if(o){j={};o.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(a,b,c){j[b]=c});break}}k=d.className;if((j!==h||e.test(k))&&!v.test(k)){m=!1;for(o=d.parentNode;o;o=o.parentNode)if(f.test(o.tagName)&&
|
||||
o.className&&e.test(o.className)){m=!0;break}if(!m){d.className+=" prettyprinted";m=j.lang;if(!m){var m=k.match(n),y;if(!m&&(y=U(d))&&t.test(y.tagName))m=y.className.match(n);m&&(m=m[1])}if(w.test(d.tagName))o=1;else var o=d.currentStyle,u=s.defaultView,o=(o=o?o.whiteSpace:u&&u.getComputedStyle?u.getComputedStyle(d,q).getPropertyValue("white-space"):0)&&"pre"===o.substring(0,3);u=j.linenums;if(!(u=u==="true"||+u))u=(u=k.match(/\blinenums\b(?::(\d+))?/))?u[1]&&u[1].length?+u[1]:!0:!1;u&&J(d,u,o);r=
|
||||
{h:m,c:d,j:u,i:o};K(r)}}}i<p.length?setTimeout(g,250):"function"===typeof a&&a()}for(var b=d||document.body,s=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],p=[],m=0;m<b.length;++m)for(var j=0,k=b[m].length;j<k;++j)p.push(b[m][j]);var b=q,c=Date;c.now||(c={now:function(){return+new Date}});var i=0,r,n=/\blang(?:uage)?-([\w.]+)(?!\S)/,e=/\bprettyprint\b/,v=/\bprettyprinted\b/,w=/pre|xmp/i,t=/^code$/i,f=/^(?:pre|code|xmp)$/i,
|
||||
h={};g()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return Y})})();}()
|
||||
BIN
html/blockly-games/favicon.ico
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
15
html/blockly-games/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<meta name="description" content="Games for tomorrow's programmers.">
|
||||
<title>Blockly Games</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="index/style.css">
|
||||
<script src="common/boot.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/index/bird.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
21
html/blockly-games/index/generated/pt-br/compressed.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// Automatically generated file. Do not edit!
|
||||
|
||||
'use strict';
|
||||
var f={},g={ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",be:"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0456","be-tarask":"Tara\u0161kievica",bg:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a",bn:"\u09ac\u09be\u0982\u09b2\u09be",br:"Brezhoneg",cs:"\u010cesky",da:"Dansk",de:"Deutsch",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English",es:"Espa\u00f1ol",eu:"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc",fi:"Suomi",fr:"Fran\u00e7ais",gl:"Galego",
|
||||
ha:"Hausa",he:"\u05e2\u05d1\u05e8\u05d9\u05ea",hi:"\u0939\u093f\u0928\u094d\u0926\u0940",hu:"Magyar",hy:"\u0570\u0561\u0575\u0565\u0580\u0567\u0576",ia:"Interlingua",id:"Bahasa Indonesia",ig:"As\u1ee5s\u1ee5 Igbo",is:"\u00cdslenska",it:"Italiano",ja:"\u65e5\u672c\u8a9e",kab:"Taqbaylit",ko:"\ud55c\uad6d\uc5b4",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",my:"\u1019\u103c\u1014\u103a\u1019\u102c\u1005\u102c",nb:"Norsk Bokm\u00e5l",nl:"Nederlands, Vlaams",pl:"Polski",pms:"Piemont\u00e8is",
|
||||
pt:"Portugu\u00eas","pt-br":"Portugu\u00eas Brasileiro",ro:"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",sc:"Sardu",sk:"Sloven\u010dina",sl:"Sloven\u0161\u010dina",sq:"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438",sv:"Svenska",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22",tr:"T\u00fcrk\u00e7e",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u064f\u0631\u062f\u064f\u0648\u202c",vi:"Ti\u1ebfng Vi\u1ec7t",yo:"\u00c8d\u00e8 Yor\u00f9b\u00e1","zh-hans":"\u7b80\u4f53\u4e2d\u6587",
|
||||
"zh-hant":"\u6b63\u9ad4\u4e2d\u6587"},k="ace ar fa he mzn ps ur".split(" "),l=window.BlocklyGamesLang,n=window.BlocklyGamesLanguages,p=".html"==window.location.pathname.substr(-5),q=Number,r,t=window.location.search.match(/[?&]level=([^&]+)/);r=t?decodeURIComponent(t[1].replace(/\+/g,"%20")):"NaN";q(r);
|
||||
function u(){document.title=document.getElementById("title").textContent;document.dir=-1!=k.indexOf(l)?"rtl":"ltr";document.head.parentElement.setAttribute("lang",l);var a=document.getElementById("languageMenu");if(a){for(var b=[],c=0;c<n.length;c++){var d=n[c];b.push([g[d],d])}b.sort(function(h,m){return h[0]>m[0]?1:h[0]<m[0]?-1:0});for(c=a.options.length=0;c<b.length;c++){var e=b[c];d=e[1];e=new Option(e[0],d);d==l&&(e.selected=!0);a.options.add(e)}1>=a.options.length&&(a.style.display="none")}for(c=
|
||||
1;10>=c;c++)a=document.getElementById("level"+c),b=!!v(f.w,c),a&&b&&(a.className+=" level_done");(c=document.querySelector('meta[name="viewport"]'))&&725>screen.availWidth&&c.setAttribute("content","width=725, initial-scale=.35, user-scalable=no");setTimeout(w,1)}
|
||||
function x(){var a=document.getElementById("languageMenu");a=encodeURIComponent(a.options[a.selectedIndex].value);var b=window.location.search;b=1>=b.length?"?lang="+a:b.match(/[?&]lang=[^&]*/)?b.replace(/([?&]lang=)[^&]*/,"$1"+a):b.replace(/\?/,"?lang="+a+"&");window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+b}function v(a,b){try{var c=window.localStorage[a+b]}catch(d){}return c}
|
||||
function y(){var a="clearData",b=z;if(!a)throw TypeError("Element not found: "+a);"string"==typeof a&&(a=document.getElementById(a));a.addEventListener("click",b,!0);a.addEventListener("touchend",b,!0)}
|
||||
function w(){if(!p){window.GoogleAnalyticsObject="GoogleAnalyticsFunction";var a=function(c){(a.q=a.q||[]).push(arguments)};window.GoogleAnalyticsFunction=a;a.l=1*new Date;var b=document.createElement("script");b.async=1;b.src="//www.google-analytics.com/analytics.js";document.head.appendChild(b);a("create","UA-50448074-1","auto");a("send","pageview")}};var A=A||{};function B(a,b){function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.C=function(d,e,h){return b.prototype[e].apply(d,Array.prototype.slice.call(arguments,2))}}if(!C){var C,D="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(D=navigator.userAgent);var E=0==D.indexOf("Opera");C={D:{u:"ScriptEngine"in window},A:E,v:!E&&-1!=D.indexOf("MSIE"),B:!E&&-1!=D.indexOf("WebKit")}}if(!F)var F={};if(!G)var G={};
|
||||
if(!H)var H={};if(!I)var I={};if(!J)var J={};if(!K)var K={};var L=A.s?{F:!0}:{};function M(){throw Error("Do not instantiate directly");}M.prototype.i=null;M.prototype.toString=function(){return this.content};function N(a){if(null!=a)switch(a.i){case 1:return 1;case -1:return-1;case 0:return 0}return null}function O(){M.call(this)}B(O,M);O.prototype.o=L;function P(a){return null!=a&&a.o===L?a:Q(String(String(a)).replace(R,S),N(a))}
|
||||
var Q=function(a){function b(){}b.prototype=a.prototype;return function(c,d){var e=new b;e.content=String(c);void 0!==d&&(e.i=d);return e}}(O),T={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":"	","\n":" ","\x0B":"","\f":"","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function S(a){return T[a]}var R=/[\x00\x22\x26\x27\x3c\x3e]/g;function U(){var a={lang:l,j:p,m:-1!=k.indexOf(l)};return'<div style="display: none"><span id="title">Jogos do Blockly</span><span id="Index_clear">Deletar todas as suas solu\u00e7\u00f5es?</span></div><div id="header"><img id="banner" src="index/title-beta.png" height="51" width="244" alt="Blockly Games"><div id="subtitle">Jogos para os programadores de amanh\u00e3. '+(a.j?'<a href="about.html?lang='+P(a.lang)+'">':'<a href="about?lang='+P(a.lang)+'">')+'Informa\u00e7\u00f5es para educadores...</a></div></div><svg height="100%" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="translate(-150,-60)"><svg height="100%" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="none" x="150" y="60"><path id="path" d="M 10,15 C 15,60 35,100 50,70 S 80,20 90,85"'+
|
||||
(a.m?'transform="translate(100) scale(-1, 1)"':"")+"/></svg>"+V({g:"puzzle",x:10,y:15,h:"Quebra-Cabe\u00e7a"},a)+V({g:"maze",x:16,y:45,h:"Labirinto"},a)+V({g:"bird",x:26,y:69,h:"P\u00e1ssaro"},a)+V({g:"turtle",x:41,y:80,h:"Tartaruga"},a)+V({g:"movie",x:55,y:61,h:"Filme"},a)+V({g:"music",x:69,y:43,h:"M\u00fasica"},a)+V({g:"pond-tutor",x:83,y:55,h:"Tutor de Lagoa"},a)+V({g:"pond-duck",x:90,y:85,h:"Lagoa"},a)+'</g></svg><select id="languageMenu"></select><p id="clearDataPara" style="visibility: hidden">Quer come\u00e7ar novamente?<button class="secondary" id="clearData">Apagar dados</span></button></p>'}
|
||||
function V(a,b){return'<svg height="150" width="300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(b.m?'x="'+P(100-a.x)+'%"':'x="'+P(a.x)+'%"')+'y="'+P(a.y)+'%"><path d="M 111.11,98.89 A 55 55 0 1 1 188.89,98.89" class="gaugeBack" id="back-'+P(a.g)+'" /><g class="icon" id="icon-'+P(a.g)+'"><circle cx="150" cy="60" r="50" class="iconBack" /><image xlink:href="index/'+P(a.g)+'.png" height="100" width="100" x="100" y="10" />'+(b.j?'<a id="link-'+P(a.g)+
|
||||
'" xlink:href="'+P(a.g)+".html?lang="+P(b.lang)+'">':'<a xlink:href="'+P(a.g)+"?lang="+P(b.lang)+'">')+'<circle cx="150" cy="60" r="50" class="iconBorder" /><path class="gaugeFront" id="gauge-'+P(a.g)+'" /><text x="150" y="135">'+P(a.h)+"</text></a></g></svg>"};
|
||||
var W="puzzle maze bird turtle movie music pond-tutor pond-duck".split(" ");
|
||||
window.addEventListener("load",function(){function a(h,m){return function(){X(h,0,m)}}document.body.innerHTML=U();u();document.getElementById("languageMenu").addEventListener("change",x,!0);for(var b=!1,c=[],d=0;d<W.length;d++){c[d]=0;for(var e=1;10>=e;e++)v(W[d],e)&&(b=!0,c[d]++)}b&&(document.getElementById("clearDataPara").style.visibility="visible",y());for(d=0;d<c.length;d++)b=W[d],(e=c[d]/(0==d?1:10)*270)?setTimeout(a(b,e),1500):(b=document.getElementById("gauge-"+b),b.parentNode.removeChild(b))},
|
||||
!1);function X(a,b,c){b+=4;Y(a,Math.min(b,c));b<c&&setTimeout(function(){X(a,b,c)},10)}function Y(a,b){var c=(b-45)*Math.PI/180,d=150-52.75*Math.cos(c),e=60-52.75*Math.sin(c);b=180<b?1:0;c=-45*Math.PI/180;var h=150-52.75*Math.cos(c);c=60-52.75*Math.sin(c);document.getElementById("gauge-"+a).setAttribute("d",["M "+h+","+c+" A",52.75,52.75,0,b,1,d,e].join(" "))}
|
||||
function z(){var a=confirm,b;(b=document.getElementById("Index_clear"))?(b=b.textContent,b=b.replace(/\\n/g,"\n")):b=null;if(a(null===b?"[Unknown message: Index_clear]":b)){for(a=0;a<W.length;a++)for(b=1;10>=b;b++)delete window.localStorage[W[a]+b];location.reload()}};
|
||||
BIN
html/blockly-games/index/maze.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
html/blockly-games/index/movie.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
html/blockly-games/index/music.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
html/blockly-games/index/pond-duck.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
html/blockly-games/index/pond-tutor.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
html/blockly-games/index/puzzle.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
186
html/blockly-games/index/style.css
Normal file
@@ -0,0 +1,186 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#languageMenu {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
html[dir="LTR"] #languageMenu {
|
||||
right: 1em;
|
||||
}
|
||||
|
||||
html[dir="RTL"] #languageMenu {
|
||||
left: 1em;
|
||||
}
|
||||
|
||||
#header {
|
||||
position: absolute;
|
||||
top: 1em;
|
||||
left: 20%;
|
||||
right: 20%;
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#banner {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
#subtitle {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#clearDataPara {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#clearData {
|
||||
padding: 0 4px;
|
||||
margin: 5px 10px;
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
#path {
|
||||
stroke: #ccc;
|
||||
stroke-width: 1;
|
||||
stroke-linecap: round;
|
||||
fill: none;
|
||||
stroke-dasharray: 180;
|
||||
stroke-dashoffset: 180;
|
||||
animation: dash .7s linear forwards;
|
||||
}
|
||||
|
||||
@keyframes dash {
|
||||
to {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.iconBack {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.iconBorder {
|
||||
stroke: #aaa;
|
||||
stroke-width: 5;
|
||||
fill: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
a:hover > .iconBorder {
|
||||
fill: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
a:hover > text {
|
||||
fill: #666;
|
||||
}
|
||||
|
||||
.icon {
|
||||
animation: pop .5s cubic-bezier(.5,.5,.5,1.5) forwards;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.icon text {
|
||||
text-anchor: middle;
|
||||
font-size: 18pt;
|
||||
}
|
||||
|
||||
#icon-puzzle {
|
||||
animation-delay: 0.0s;
|
||||
}
|
||||
|
||||
#icon-maze {
|
||||
animation-delay: 0.1s;
|
||||
}
|
||||
|
||||
#icon-bird {
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
|
||||
#icon-turtle {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
|
||||
#icon-movie {
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
|
||||
#icon-music {
|
||||
animation-delay: 0.5s;
|
||||
}
|
||||
|
||||
#icon-pond-tutor {
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
|
||||
#icon-pond-duck {
|
||||
animation-delay: 0.7s;
|
||||
}
|
||||
|
||||
#back-puzzle {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
|
||||
#back-maze {
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
|
||||
#back-bird {
|
||||
animation-delay: 0.5s;
|
||||
}
|
||||
|
||||
#back-turtle {
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
|
||||
#back-movie {
|
||||
animation-delay: 0.7s;
|
||||
}
|
||||
|
||||
#back-music {
|
||||
animation-delay: 0.8s;
|
||||
}
|
||||
|
||||
#back-pond-tutor {
|
||||
animation-delay: 0.9s;
|
||||
}
|
||||
|
||||
#back-pond-duck {
|
||||
animation-delay: 1.0s;
|
||||
}
|
||||
|
||||
@keyframes pop {
|
||||
from {
|
||||
transform: translate(150px, 50px) scale(0);
|
||||
visibility: visible;
|
||||
}
|
||||
to {
|
||||
transform: translate(0, 0) scale(1);
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.gaugeBack {
|
||||
stroke: #aaa;
|
||||
stroke-width: 6;
|
||||
fill: none;
|
||||
animation: pop 0.1s linear forwards;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.gaugeFront {
|
||||
stroke: #0b0;
|
||||
stroke-width: 8;
|
||||
fill: none;
|
||||
}
|
||||
BIN
html/blockly-games/index/title-beta.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
html/blockly-games/index/turtle.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
15
html/blockly-games/maze.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Maze</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="maze/style.css">
|
||||
<script src="common/boot.js"></script>
|
||||
<script src="/common/storage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/maze/astro.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
html/blockly-games/maze/bg_astro.jpg
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
html/blockly-games/maze/bg_panda.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
html/blockly-games/maze/fail_astro.mp3
Normal file
BIN
html/blockly-games/maze/fail_astro.ogg
Normal file
BIN
html/blockly-games/maze/fail_panda.mp3
Normal file
BIN
html/blockly-games/maze/fail_panda.ogg
Normal file
BIN
html/blockly-games/maze/fail_pegman.mp3
Normal file
BIN
html/blockly-games/maze/fail_pegman.ogg
Normal file
637
html/blockly-games/maze/generated/pt-br/compressed.js
Normal file
BIN
html/blockly-games/maze/help_down.png
Normal file
|
After Width: | Height: | Size: 589 B |
BIN
html/blockly-games/maze/help_run.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
html/blockly-games/maze/help_stack.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
html/blockly-games/maze/help_up.png
Normal file
|
After Width: | Height: | Size: 544 B |
BIN
html/blockly-games/maze/icons.png
Normal file
|
After Width: | Height: | Size: 511 B |
BIN
html/blockly-games/maze/marker.png
Normal file
|
After Width: | Height: | Size: 859 B |
BIN
html/blockly-games/maze/panda.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
html/blockly-games/maze/pegman.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
145
html/blockly-games/maze/style.css
Normal file
@@ -0,0 +1,145 @@
|
||||
#blockly {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
}
|
||||
#visualization {
|
||||
position: relative;
|
||||
}
|
||||
#capacityBubble {
|
||||
position: absolute;
|
||||
margin-top: -0.5em;
|
||||
left: 10px;
|
||||
top: 375px;
|
||||
width: 380px;
|
||||
}
|
||||
html[dir="RTL"] #capacityBubble {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
#capacity {
|
||||
display: none;
|
||||
color: #fff;
|
||||
padding: 5px 1em;
|
||||
border-radius: 15px;
|
||||
background-color: rgba(64,64,64,0.7);
|
||||
font-size: large;
|
||||
}
|
||||
.capacityNumber {
|
||||
font-weight: bold;
|
||||
}
|
||||
#sampleOneTopBlock {
|
||||
height: 80px;
|
||||
width: 250px;
|
||||
}
|
||||
#pegSpin {
|
||||
height: 50px;
|
||||
width: 49px;
|
||||
background-position: -343px 0px;
|
||||
margin-top: 10px;
|
||||
position: absolute;
|
||||
}
|
||||
html[dir="RTL"] #pegSpin {
|
||||
background-position: -441px 0px;
|
||||
}
|
||||
|
||||
.helpMenuFake {
|
||||
border-radius: 4px;
|
||||
background-color: #bfcdde;
|
||||
color: #000;
|
||||
padding: 0 1ex;
|
||||
cursor: default;
|
||||
}
|
||||
img[src$="help_up.png"] {
|
||||
margin: -20px 10px 0;
|
||||
height: 64px;
|
||||
width: 23px;
|
||||
}
|
||||
img[src$="help_down.png"] {
|
||||
margin: 0 10px -20px;
|
||||
height: 64px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
#svgMaze {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 'Look' icon */
|
||||
#look>path {
|
||||
display: none;
|
||||
fill: none;
|
||||
stroke-width: 10;
|
||||
stroke-linecap: round;
|
||||
stroke-opacity: 0.7;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
button.primary {
|
||||
/* Can't use "text-align: start" due to IE. */
|
||||
text-align: left;
|
||||
}
|
||||
html[dir="RTL"] button.primary {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Sprited icons. */
|
||||
.icon21 {
|
||||
height: 21px;
|
||||
width: 21px;
|
||||
background-image: url(icons.png);
|
||||
}
|
||||
.link {
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
.run {
|
||||
background-position: 0px -21px;
|
||||
}
|
||||
.stop {
|
||||
background-position: -21px -21px;
|
||||
}
|
||||
|
||||
#pegmanButton {
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
#pegmanButton:active {
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
#pegmanButton>img {
|
||||
margin-left: -0.5ex;
|
||||
margin-right: 0.5ex;
|
||||
height: 38px;
|
||||
width: 49px;
|
||||
background-position: -980px 0px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
html[dir="RTL"] #pegmanButton>img {
|
||||
margin-left: 0.5ex;
|
||||
margin-right: -0.5ex;
|
||||
}
|
||||
#pegmanButton>span {
|
||||
position: absolute;
|
||||
top: 0.8ex;
|
||||
margin-left: -15px;
|
||||
}
|
||||
html[dir="RTL"] #pegmanButton>span {
|
||||
margin-right: -15px;
|
||||
}
|
||||
#pegmanMenu {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
box-shadow: 2px 2px 5px #888;
|
||||
display: none;
|
||||
position: absolute;
|
||||
}
|
||||
#pegmanMenu>div {
|
||||
background-color: #fff;
|
||||
}
|
||||
#pegmanMenu>div:hover {
|
||||
background-color: #57e;
|
||||
}
|
||||
#pegmanMenu>div>img {
|
||||
height: 38px;
|
||||
width: 49px;
|
||||
background-position: -980px 0px;
|
||||
}
|
||||
BIN
html/blockly-games/maze/tiles_astro.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
html/blockly-games/maze/tiles_panda.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
html/blockly-games/maze/tiles_pegman.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
html/blockly-games/maze/win.mp3
Normal file
BIN
html/blockly-games/maze/win.ogg
Normal file
15
html/blockly-games/movie.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Movie</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="movie/style.css">
|
||||
<script src="common/boot.js"></script>
|
||||
<script src="/common/storage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
903
html/blockly-games/movie/generated/pt-br/compressed.js
Normal file
BIN
html/blockly-games/movie/icons.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
94
html/blockly-games/movie/style.css
Normal file
@@ -0,0 +1,94 @@
|
||||
button.primary {
|
||||
/* Can't use "text-align: start" due to IE. */
|
||||
text-align: left;
|
||||
}
|
||||
html[dir="RTL"] button.primary {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#blockly {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
}
|
||||
#display {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
#downloadImageLink {
|
||||
display: none;
|
||||
}
|
||||
#sampleHelp2 {
|
||||
height: 50px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 150%; margin: 0 1em;
|
||||
}
|
||||
|
||||
html code.rtl {
|
||||
display: none;
|
||||
}
|
||||
html code.ltr {
|
||||
display: inline;
|
||||
}
|
||||
html[dir="RTL"] code.rtl {
|
||||
display: inline;
|
||||
}
|
||||
html[dir="RTL"] code.ltr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#coordinates {
|
||||
display: none;
|
||||
font-size: 10pt;
|
||||
margin-top: 5px;
|
||||
position: absolute;
|
||||
width: 400px;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
#x {
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
}
|
||||
#y {
|
||||
position: absolute;
|
||||
left: 350px;
|
||||
}
|
||||
|
||||
/* Slider. */
|
||||
.sliderTrack {
|
||||
stroke: #aaa;
|
||||
stroke-width: 6px;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
.sliderKnob {
|
||||
fill: #ddd;
|
||||
stroke: #bbc;
|
||||
stroke-width: 1px;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.sliderKnob:hover {
|
||||
fill: #eee;
|
||||
}
|
||||
|
||||
/* Sprited icons. */
|
||||
.icon21 {
|
||||
height: 21px;
|
||||
width: 21px;
|
||||
background-image: url(icons.png);
|
||||
}
|
||||
.camera {
|
||||
background-position: -21px 0px;
|
||||
}
|
||||
.stop {
|
||||
background-position: -42px 0px;
|
||||
}
|
||||
.run {
|
||||
background-position: -63px 0px;
|
||||
}
|
||||
.gallery {
|
||||
background-position: -42px -21px;
|
||||
}
|
||||
BIN
html/blockly-games/movie/win.mp3
Normal file
BIN
html/blockly-games/movie/win.ogg
Normal file
BIN
html/blockly-games/movie/youtube-bg.png
Normal file
|
After Width: | Height: | Size: 385 B |
15
html/blockly-games/music.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Music</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="music/style.css">
|
||||
<script src="common/boot.js"></script>
|
||||
<script src="/common/storage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/music/black1x1.gif
Normal file
|
After Width: | Height: | Size: 35 B |
854
html/blockly-games/music/generated/pt-br/compressed.js
Normal file
BIN
html/blockly-games/music/icons.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
html/blockly-games/music/note0.03125.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
html/blockly-games/music/note0.0625.png
Normal file
|
After Width: | Height: | Size: 881 B |
BIN
html/blockly-games/music/note0.125.png
Normal file
|
After Width: | Height: | Size: 706 B |
BIN
html/blockly-games/music/note0.25.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
html/blockly-games/music/note0.5.png
Normal file
|
After Width: | Height: | Size: 566 B |
BIN
html/blockly-games/music/note1.png
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
html/blockly-games/music/notes.png
Normal file
|
After Width: | Height: | Size: 894 B |
BIN
html/blockly-games/music/play.png
Normal file
|
After Width: | Height: | Size: 392 B |
BIN
html/blockly-games/music/rest0.03125.png
Normal file
|
After Width: | Height: | Size: 861 B |
BIN
html/blockly-games/music/rest0.0625.png
Normal file
|
After Width: | Height: | Size: 662 B |
BIN
html/blockly-games/music/rest0.125.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
html/blockly-games/music/rest0.25.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
html/blockly-games/music/rest0.5.png
Normal file
|
After Width: | Height: | Size: 163 B |
BIN
html/blockly-games/music/rest1.png
Normal file
|
After Width: | Height: | Size: 158 B |
BIN
html/blockly-games/music/stave.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
157
html/blockly-games/music/style.css
Normal file
@@ -0,0 +1,157 @@
|
||||
button.primary {
|
||||
/* Can't use "text-align: start" due to IE. */
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
html[dir="RTL"] button.primary {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#blockly {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
#paddingBox {
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#staveBox {
|
||||
position: absolute;
|
||||
border: 1px solid #ccc;
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.stave {
|
||||
height: 69px;
|
||||
width: 400px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.note {
|
||||
height: 37px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.rest {
|
||||
height: 31px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.splash {
|
||||
transition-property: height, opacity, width, margin;
|
||||
transition-duration: .3s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.splash.note {
|
||||
margin-left: -10px;
|
||||
margin-top: -30px;
|
||||
height: 74px;
|
||||
}
|
||||
|
||||
.splash.rest {
|
||||
margin-left: -8px;
|
||||
margin-top: -6px;
|
||||
height: 62px;
|
||||
}
|
||||
|
||||
.goal {
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
filter: invert(50%) sepia(100%) saturate(10000%)
|
||||
}
|
||||
|
||||
.ledgerLine {
|
||||
height: 1px;
|
||||
width: 20px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.ledgerLineWide {
|
||||
height: 1px;
|
||||
width: 27px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.barLine {
|
||||
height:36px;
|
||||
width: 1px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#musicBox {
|
||||
direction: ltr;
|
||||
position: absolute;
|
||||
height: 400px;
|
||||
width: 365px;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
margin-left: 36px;
|
||||
}
|
||||
|
||||
#notePicker {
|
||||
background-image: url(notes.png);
|
||||
border: 1px solid #ccc;
|
||||
height: 109px;
|
||||
width: 46px;
|
||||
}
|
||||
|
||||
.sampleNote {
|
||||
float: left;
|
||||
height: 37px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
html[dir="RTL"] .sampleNote {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#sampleHelp2 {
|
||||
height: 150px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#sampleHelp6, #sampleHelp7 {
|
||||
height: 50px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
/* Slider. */
|
||||
.sliderTrack {
|
||||
stroke: #aaa;
|
||||
stroke-width: 6px;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
.sliderKnob {
|
||||
fill: #ddd;
|
||||
stroke: #bbc;
|
||||
stroke-width: 1px;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.sliderKnob:hover {
|
||||
fill: #eee;
|
||||
}
|
||||
|
||||
/* Sprited icons. */
|
||||
.icon21 {
|
||||
height: 21px;
|
||||
width: 21px;
|
||||
background-image: url(icons.png);
|
||||
}
|
||||
.camera {
|
||||
background-position: -21px 0px;
|
||||
}
|
||||
.stop {
|
||||
background-position: -42px 0px;
|
||||
}
|
||||
.run {
|
||||
background-position: -63px 0px;
|
||||
}
|
||||
.gallery {
|
||||
background-position: -63px -21px;
|
||||
}
|
||||
16
html/blockly-games/pond-duck.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Pond</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="pond/style.css">
|
||||
<link rel="stylesheet" href="pond/duck/style.css">
|
||||
<script src="third-party/ace/ace.js"></script>
|
||||
<script src="common/boot.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
17
html/blockly-games/pond-tutor.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>Blockly Games : Pond Tutor</title>
|
||||
<link rel="stylesheet" href="common/common.css">
|
||||
<link rel="stylesheet" href="pond/style.css">
|
||||
<link rel="stylesheet" href="pond/tutor/style.css">
|
||||
<script src="third-party/ace/ace.js"></script>
|
||||
<script src="common/boot.js"></script>
|
||||
<script src="/common/storage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/pond/boom.mp3
Normal file
BIN
html/blockly-games/pond/boom.ogg
Normal file
69
html/blockly-games/pond/crobots.txt
Normal file
@@ -0,0 +1,69 @@
|
||||
Pond is a reimplementation of Tom Poindexter's 1985 game CROBOTS. Google has
|
||||
(with the author's permission) updated the game to be playable by a new
|
||||
generation of programmers.
|
||||
|
||||
Differences between Pond and CROBOTS:
|
||||
|
||||
* Theme
|
||||
CROBOTS features robots fighting in a battlefield. Given today's diversity
|
||||
priorities, a different theme was needed. The reimplementation features
|
||||
rubber ducks in a pond.
|
||||
|
||||
* Battlefield size
|
||||
Height and width of battlefield is 100m x 100m instead of 1000m x 1000m.
|
||||
Since speed and damage/health go to 100, scaling the pond's size to the same
|
||||
magnitude makes for a cleaner API. This was not possible in CROBOTS since
|
||||
integers were the only data type, whereas JavaScript has floats.
|
||||
|
||||
* Scan resolution
|
||||
CROBOTS scans in a direction with a resolution of +/- n degrees. Pond scans
|
||||
with a total resolution of n degrees. The only difference is that Pond's
|
||||
resolution number is double that specified in CROBOTS.
|
||||
|
||||
* Failed scan
|
||||
CROBOTS returns 0 for a scan that failed to detect another player.
|
||||
Pond returns Infinity.
|
||||
|
||||
* Impact damage
|
||||
CROBOTS gives a flat 2% damage to robots colliding with a wall or another robot.
|
||||
Pond gives up to 3% damage, proportional to the speed at impact.
|
||||
|
||||
* Blast damage
|
||||
CROBOTS gives 3%/5%/10% damage to robots within 40m/20m/5m of an explosion.
|
||||
Pond uses a proportional formula ((1 - r / 4) * 10) which is similar (after
|
||||
accounting for the 10x decrease in battlefield size), but slightly increases
|
||||
the value of accuracy.
|
||||
|
||||
* Swim
|
||||
Because of the rubber duck theme, 'swim()' has been added as an alias to
|
||||
CROBOT's 'drive()'. Pond supports 'drive()' as an undocumented function.
|
||||
|
||||
* Stop
|
||||
Pond introduces a new function 'stop()' that is the equivalent of
|
||||
'drive(0, d)', where d is the current driving direction.
|
||||
|
||||
* Health
|
||||
People are more used to games having 'health' (more is better) rather than
|
||||
'damage' (less is better). Pond introduces 'health()', with 'damage()' being
|
||||
an undocumented function.
|
||||
|
||||
* Trigonometry
|
||||
CROBOTS has top-level sin/cos/tan/atan functions that use degrees.
|
||||
Pond adds these to the JavaScript Math object as Math.sin_deg/Math.cos_deg/etc.
|
||||
|
||||
* Constants
|
||||
Various constants such as acceleration rate, robot-missile speed ratio, etc are
|
||||
tuned differently. These differences are not intentional.
|
||||
|
||||
Google is indebted to Tom Poindexter for inspiring so many young people to
|
||||
learn about programming through his game. We hope to continue this success
|
||||
with Pond. As with CROBOTS, all the code for Pond is open source.
|
||||
|
||||
The original DOS-based CROBOTS game may be found here:
|
||||
http://crobots.deepthought.it/home.php
|
||||
https://github.com/tpoindex/crobots/
|
||||
|
||||
--
|
||||
Neil Fraser
|
||||
Google, California
|
||||
August 2014
|
||||
13
html/blockly-games/pond/docs.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="google" value="notranslate">
|
||||
<title>Blockly Games : Pond Documentation</title>
|
||||
<link rel="stylesheet" href="../common/common.css">
|
||||
<link rel="stylesheet" href="docs/style.css">
|
||||
<script src="../common/boot.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
BIN
html/blockly-games/pond/docs/compass.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
38
html/blockly-games/pond/docs/generated/pt-br/compressed.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// Automatically generated file. Do not edit!
|
||||
|
||||
'use strict';
|
||||
var e=Number,f,g=window.location.search.match(/[?&]level=([^&]+)/);f=g?decodeURIComponent(g[1].replace(/\+/g,"%20")):"NaN";e(f);if(!h){var h,k="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(k=navigator.userAgent);var l=0==k.indexOf("Opera");h={l:{g:"ScriptEngine"in window},i:l,h:!l&&-1!=k.indexOf("MSIE"),j:!l&&-1!=k.indexOf("WebKit")}}if(!m)var m={};if(!n)var n={};if(!p)var p={};if(!q)var q={};if(!r)var r={};if(!t)var t={};
|
||||
function u(b){b=b.currentTarget;var a=document.getElementById(b.id+"-content"),c="zippy-content-expanded"==a.className;b.className="zippy-header-"+(c?"collapsed":"expanded");a.className="zippy-content-"+(c?"collapsed":"expanded");a.style.maxHeight=c?0:a.scrollHeight+"px"}
|
||||
window.addEventListener("load",function(){var b=window.location.search.match(/[?&]mode=([^&]+)/);b=b?Number(b[1]):Infinity;var a=b%2?"blocks":"js";document.body.innerHTML='<h1>Pond Documentation</h1><h2 id="pond">Pond</h2><div id="pond-content"><h3>Angles</h3><p>The compass is oriented so that due east (right) is 0 degrees, 90 is north, 180 is west, 270 is south. Angles wrap as expected: -90 is south, 450 is north.</p><p><img src="docs/compass.png" height="145" width="150" style="padding: 0 2em;"></p><h3>Cannon</h3>'+("blocks"==
|
||||
a?'<p><svg height="41" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36071014404297 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01641845703125,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z M 193.4027557373047,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36071014404297 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01641845703125,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z M 193.4027557373047,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 221.86071014404297 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 125.51641845703125,5.5 v 27 h -36.020530700683594 M 83.89588775634766,24.3 l 3.68,-2.1 M 193.9027557373047,5.5 v 27 h -38.31193542480469 M 149.9908203125,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">cannon</text><text class="blocklyText" y="12.5" transform="translate(68.11233520507812,10)">(</text><text class="blocklyText" y="12.5" transform="translate(135.01641845703125,10)">,</text><text class="blocklyText" y="12.5" transform="translate(203.4027557373047,10)">);</text><g class="blocklyDraggable" transform="translate(89.99588775634766,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g><g class="blocklyDraggable" transform="translate(156.0908203125,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 35.81193542480469 M 35.81193542480469,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="26.311935424804688"></rect><text class="blocklyText" y="12.5">70</text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">cannon(<i>angle</i>, <i>range</i>)</pre>':"")+"<p>The <code>cannon()</code> function fires a cannonball towards the specified angle and range. The angle is independent of the direction of the duck. The range can be 0-70 metres, with greater ranges truncated to 70.</p><p>The cannon takes about one second to reload after firing. If <code>cannon()</code> is called during this time, nothing happens."+("js"==a?" <code>cannon()</code> returns <code>true</code> if a cannonball was fired, or <code>false</code> if the cannon is reloading.":
|
||||
"")+"</p>"+(5<=b?"<h3>Scan</h3>"+("blocks"==a?'<p><svg height="37" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 20 H 132.76456451416016 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88101196289062,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 20 H 132.76456451416016 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88101196289062,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 132.26456451416016 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 108.38101196289062,5.5 v 27 h -36.020530700683594 M 66.76048126220704,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">scan</text><text class="blocklyText" y="12.5" transform="translate(50.9769287109375,10)">(</text><text class="blocklyText" y="12.5" transform="translate(117.88101196289062,10)">)</text><g class="blocklyDraggable" transform="translate(72.86048126220703,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">scan(<i>angle</i>)\nscan(<i>angle</i>, <i>width</i>)</pre>':"")+"<p>The <code>scan()</code> function activates the duck's radar. This function returns the range to the nearest opponent in the specified direction. The angle is independent of the direction of the duck. Sunk opponents are not detected. If there is no opponent in that direction, then <code>Infinity</code> is returned.</p>"+("js"==a?"<p>The second (optional) parameter of <code>scan()</code> specifies the width of the scanning beam. This can be from 1 degree to 20 degrees. Advanced players may wish to start scanning with a width of 20 for a fast scan, then progressively decrease the width to get more accuracy. If not specified, the width is 5. This parameter is only available with JavaScript, not with blocks.</p>":
|
||||
""):"")+(7<=b?"<h3>Swim</h3>"+("blocks"==a?'<p><svg height="41" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.2592544555664 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.30130004882812,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.2592544555664 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.30130004882812,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 138.7592544555664 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 110.80130004882812,5.5 v 27 h -36.020530700683594 M 69.18076934814454,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">swim</text><text class="blocklyText" y="12.5" transform="translate(53.397216796875,10)">(</text><text class="blocklyText" y="12.5" transform="translate(120.30130004882812,10)">);</text><g class="blocklyDraggable" transform="translate(75.28076934814453,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">swim(<i>angle</i>)\nswim(<i>angle</i>, <i>speed</i>)</pre>':"")+"<p>The <code>swim()</code> function starts the duck moving. The duck will continue moving in the specified direction indefinitely.</p>"+("js"==a?"<p>The second (optional) parameter of <code>swim()</code> specifies the speed. This can be from 0 (stopped) to 100 (fast). Direction of movement may only be changed if the speed is 50 or less. If not specified, the speed is 50. This parameter is only available with JavaScript, not with blocks.</p>":
|
||||
"")+"<p>Crashing into the edges of the pond will damage your duck. Crashing into other ducks will damage both ducks. The amount of damage is proportional to your speed.</p>":"")+(9<=b?"<h3>Stop</h3>"+("blocks"==a?'<p><svg height="31" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56034088134766 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56034088134766 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 81.06034088134766 M 81.06034088134766,0.5 M 2.6966991411008934,21.303300858899107 A 7.5,7.5 0 0,1 0.5,16 V 8"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">stop</text><text class="blocklyText" y="12.5" transform="translate(47.718833923339844,5)">(</text><text class="blocklyText" y="12.5" transform="translate(62.602386474609375,5)">);</text></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">stop()</pre>':"")+"<p>The <code>stop()</code> function stops the duck from moving. The duck will take a moment to slow down before stopping completely."+("js"==a?"This is the same as calling <code>swim()</code> with a speed of zero.":"")+"</p>":"")+(9<=b?"<h3>Location</h3>"+("blocks"==a?'<p><svg height="26" width="90"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 79.43487548828125 M 79.43487548828125,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">getX</text><text class="blocklyText" y="12.5" transform="translate(50.16777038574219,5)">(</text><text class="blocklyText" y="12.5" transform="translate(65.05132293701172,5)">)</text></g></svg> <svg height="26" width="90"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 79.43487548828125 M 79.43487548828125,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">getY</text><text class="blocklyText" y="12.5" transform="translate(50.16777038574219,5)">(</text><text class="blocklyText" y="12.5" transform="translate(65.05132293701172,5)">)</text></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">getX()\ngetY()</pre>':"")+'<p>The <code>getX()</code> and <code>getY()</code> functions return the duck\'s horizontal and vertical positions. Values are between 0 and 100, starting from the lower-left corner.</p><p><img src="docs/map.png" height="190" width="244" style="padding: 0 2em;"></p>':"")+(11<=b?"<h3>Speed</h3>"+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 89.72347259521484 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 89.72347259521484 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 89.22347259521484 M 89.22347259521484,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">speed</text><text class="blocklyText" y="12.5" transform="translate(59.95636749267578,5)">(</text><text class="blocklyText" y="12.5" transform="translate(74.83992004394531,5)">)</text></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">speed()</pre>':"")+"<p>The <code>speed()</code> function returns the duck's current speed. Values are between 0 (stopped) and 100 (fast). This function may be used to detect collisions (which instantly stop the duck).</p>":"")+(11<=b?"<h3>Health</h3>"+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 89.72346496582031 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 89.72346496582031 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 89.22346496582031 M 89.22346496582031,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">health</text><text class="blocklyText" y="12.5" transform="translate(59.95635986328125,5)">(</text><text class="blocklyText" y="12.5" transform="translate(74.83991241455078,5)">)</text></g></svg></p>':
|
||||
"js"==a?'<pre class="pondSpec spec">health()</pre>':"")+"<p>The <code>health()</code> function returns the duck's current health level. Values are between 0 (sunk) and 100 (perfect). Advanced players may wish to store the health in a variable, then periodically check to see if the health has decreased, thus indicating that the duck is under attack.</p><p>There is no way to repair health.</p>":"")+"</div>"+(3<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e<h2 id="logic">Logic</h2><div id="logic-content">'+
|
||||
(9<=b?"<h3>If</h3>"+("blocks"==a?'<p><svg height="90" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 117.64627075195312 v 35 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 83.79044342041016,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 117.64627075195312 v 35 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 83.79044342041016,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 49.5 M 49.5,0.5 H 117.14627075195312 M 49.5,35.5 M 21.989592359914347,58.01040764008565 a 8.5,8.5 0 0,0 6.0104076400856545,2.4895923599143455 H 49.5 M 49.5,60.5 H 49.5 M 2.6966991411008934,82.3033008588991 A 7.5,7.5 0 0,1 0.5,77 V 8 M 84.29044342041016,5.5 v 26 h -14.5 M 64.19044342041016,24.3 l 3.68,-2.1"></path><g class="blocklyIconGroup" display="block" transform="translate(10,5)"><rect class="blocklyIconShape" rx="4" ry="4" height="16" width="16"></rect><path class="blocklyIconSymbol" d="m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"></path><circle class="blocklyIconShape" r="2.7" cx="8" cy="8"></circle></g><text class="blocklyText" y="12.5" transform="translate(37,10)">if (</text><text class="blocklyText" y="12.5" transform="translate(93.79044342041016,10)">) {</text><text class="blocklyText" y="12.5" transform="translate(10,65)">}</text></g></svg></p>':
|
||||
"js"==a?'<pre class="logicSpec spec">if (<i>condition</i>) {\n <i>statements</i>\n}\n\n\nif (<i>condition</i>) {\n <i>statements</i>\n} else if (<i>condition</i>) {\n <i>statements</i>\n}\n\n\nif (<i>condition</i>) {\n <i>statements</i>\n} else {\n <i>statements</i>\n}</pre>':"")+"<p>If the condition is true, then execute the contained statements. The <code>if</code> may be followed by any number of other <code>else if</code> conditions, and at the end by an optional <code>else</code> condition that executes if none of the previous conditions were true.</p>":
|
||||
"")+(9<=b?"<h3>Equality</h3>"+("blocks"==a?'<p><svg height="36" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,0 H 20 H 111.56876373291016 v 35 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 30.5,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z M 101.56876373291016,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,0 H 20 H 111.56876373291016 v 35 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 30.5,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z M 101.56876373291016,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 111.06876373291016 M 0.5,34.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 31,5.5 v 26 h -14.5 M 10.9,24.3 l 3.68,-2.1 M 102.06876373291016,5.5 v 26 h -14.5 M 81.96876373291016,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(40.5,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="40.568763732910156"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">==<tspan style="fill: rgb(91, 128, 165);"> \u25be</tspan></text></g></g></svg></p>':
|
||||
"js"==a?'<pre class="logicSpec spec">== != < <= > >=</pre>':"")+"<p>These expressions compare two numbers and return <code>true</code> or <code>false</code>. The six available equality operators are:</p><table><tr><th>Operator</td><th>Example</td><th>Returns</td></tr><tr><td>Equals</td><td><code>5 == 10</code></td><td><code>false</code></td></tr><tr><td>Not equals</td><td><code>5 != 10</code></td><td><code>true</code></td></tr><tr><td>Less than</td><td><code>5 < 10</code></td><td><code>true</code></td></tr><tr><td>Less than or equal</td><td><code>5 <= 10</code></td><td><code>true</code></td></tr><tr><td>Greater than</td><td><code>5 > 10</code></td><td><code>false</code></td></tr><tr><td>Greater than or equal</td><td><code>5 >= 10</code></td><td><code>false</code></td></tr></table><p>Use of <code>!=</code> may be dangerous if the numbers being compared are fractions. Consider this code that is designed to swim to 50 then stop:</p><pre>while (getY() <b>!=</b> 50) {\n swim(90"+
|
||||
("js"==a?", 50":"")+");\n}\nstop();</pre><p>The above code will fail because <code>getY()</code> may be 49.4 on one execution, then 50.6 on the next execution. Since the value was not seen at exactly 50, the loop continues forever. Below is better code:</p><pre>while (getY() <b><</b> 50) {\n swim(90"+("js"==a?", 50":"")+");\n}\nstop();</pre>":"")+(11<=b?"<h3>And/Or</h3>"+("blocks"==a?'<p><svg height="36" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,0 H 20 H 114.00337982177734 v 35 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 30.5,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z M 104.00337982177734,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,0 H 20 H 114.00337982177734 v 35 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 30.5,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z M 104.00337982177734,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 113.50337982177734 M 0.5,34.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 31,5.5 v 26 h -14.5 M 10.9,24.3 l 3.68,-2.1 M 104.50337982177734,5.5 v 26 h -14.5 M 84.40337982177735,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(40.5,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="43.003379821777344"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">&&<tspan style="fill: rgb(91, 128, 165);"> \u25be</tspan></text></g></g></svg></p>':
|
||||
"js"==a?'<pre class="logicSpec spec">&& ||</pre>':"")+"<p>'And' is represented by the <code>&&</code> operator. It returns <code>true</code> only if both inputs are <code>true</code>. For example this code will only fire the cannon if the range is both greater than 5 and less than 70:</p><pre>if (range > 5 <b>&&</b> range < 70) {\n cannon(angle, range);\n}</pre><p>'Or' is represented by the <code>||</code> operator. It returns <code>true</code> if either input is <code>true</code>. For example this code will stop if the duck is close to any wall:</p><pre>if (getX() < 10 <b>||</b> getX() > 90 <b>||</b>\n getY() < 10 <b>||</b> getY() > 90) {\n stop();\n}</pre>":
|
||||
"")+"<h3>Booleans</h3>"+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,0 H 58.71040344238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,0 H 58.71040344238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 58.21040344238281 M 58.21040344238281,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="48.71040344238281"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">true<tspan style="fill: rgb(91, 128, 165);"> \u25be</tspan></text></g></g></svg></p>':
|
||||
"js"==a?'<pre class="logicSpec spec">true false</pre>':"")+"<p>The value <code>true</code> is mainly used by the while loop to make a loop that executes forever. The value <code>false</code> is also available.</p></div>":"")+(3<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e<h2 id="loops">Loops</h2><div id="loops-content"><h3>While</h3>'+("blocks"==a?'<p><svg height="90" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#498449" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 116.73247528076172 v 35 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 82.87664794921875,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPath" fill="#5ba55b" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 116.73247528076172 v 35 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 82.87664794921875,5 h -14.5 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 14.5 z"></path><path class="blocklyPathLight" stroke="#8cc08c" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 49.5 M 49.5,0.5 H 116.23247528076172 M 49.5,35.5 M 21.989592359914347,58.01040764008565 a 8.5,8.5 0 0,0 6.0104076400856545,2.4895923599143455 H 49.5 M 49.5,60.5 H 49.5 M 2.6966991411008934,82.3033008588991 A 7.5,7.5 0 0,1 0.5,77 V 8 M 83.37664794921875,5.5 v 26 h -14.5 M 63.27664794921875,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">while (</text><text class="blocklyText" y="12.5" transform="translate(92.87664794921875,10)">) {</text><text class="blocklyText" y="12.5" transform="translate(10,65)">}</text></g></svg></p>':
|
||||
"js"==a?'<pre class="loopsSpec spec">while (<i>condition</i>) {\n <i>statements</i>\n}</pre>':"")+"<p>Loops will repeat executing the enclosed statements as long as the condition is true. Thus, the following will fire the cannon west forever:</p><pre>while (true) {\n cannon(180, 50);\n}</pre><p>Whereas the following will fire the canon west as long as an opponent is in range:</p><pre>while (scan(180"+("js"==a?", 5":"")+") <= 70) {\n cannon(180, scan(180"+("js"==a?", 5":"")+"));\n}</pre></div>":
|
||||
"")+'\x3c!-- ---------------------------------------------------------------------- --\x3e<h2 id="math">Math</h2><div id="math-content"><h3>Number</h3>'+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">0</text></g></g></svg></p>':
|
||||
"js"==a?'<pre class="mathSpec spec">123</pre>':"")+"<p>Numbers are used for many things, including ranges, angles, and counters. Numbers may be negative (e.g. -360), or fractional (e.g. 3.14159), or very large (e.g. 9007199254740992). There is even a special number called <code>Infinity</code>.</p><p>Do not use thousands separators (e.g. 9,000).</p>"+(11<=b?"<h3>Arithmetic</h3>"+("blocks"==a?'<p><svg height="36" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 20 H 134.3165740966797 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 46.155967712402344,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z M 124.31657409667969,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 20 H 134.3165740966797 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 46.155967712402344,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z M 124.31657409667969,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 133.8165740966797 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 46.655967712402344,5.5 v 27 h -30.155967712402344 M 10.9,24.3 l 3.68,-2.1 M 124.81657409667969,5.5 v 27 h -30.155967712402344 M 89.06060638427735,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(56.155967712402344,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="32.004638671875"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">+<tspan style="fill: rgb(91, 103, 165);"> \u25be</tspan></text></g><g class="blocklyDraggable" transform="translate(95.16060638427734,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">2</text></g></g><g class="blocklyDraggable" transform="translate(16.999999999999943,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">1</text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="mathSpec spec">+ - * /</pre>':"")+"<p>These operators take two numbers and return a single number. The four available arithmetic operators are:</p><table><tr><th>Operator</td><th>Example</td><th>Returns</td></tr><tr><td>Plus</td><td><code>3 + 4</code></td><td><code>7</code></td></tr><tr><td>Minus</td><td><code>3 - 4</code></td><td><code>-1</code></td></tr><tr><td>Multiply</td><td><code>3 * 4</code></td><td><code>12</code></td></tr><tr><td>Divide</td><td><code>3 / 4</code></td><td><code>0.75</code></td></tr></table>":
|
||||
"")+(11<=b?"<h3>Trigonometry</h3>"+("blocks"==a?'<p><svg height="36" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 20 H 170.4867935180664 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 145.60324096679688,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 20 H 170.4867935180664 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 145.60324096679688,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 169.9867935180664 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 146.10324096679688,5.5 v 27 h -30.155967712402344 M 110.34727325439454,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(10,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="84.563720703125"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">Math.sqrt<tspan style="fill: rgb(91, 103, 165);"> \u25be</tspan></text></g><text class="blocklyText" y="12.5" transform="translate(94.563720703125,10)">(</text><text class="blocklyText" y="12.5" transform="translate(155.60324096679688,10)">)</text><g class="blocklyDraggable" transform="translate(116.44727325439453,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">9</text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="mathSpec spec">Math.<i>operation</i>(<i>number</i>)</pre>':"")+"<p>These functions take a number and return a number. The eight available functions are:</p><table><tr><th>Function</td><th>Example</td><th>Returns</td></tr><tr><td>Square root</td><td><code>Math.sqrt(25)</code></td><td><code>5</code></td></tr><tr><td>Absolute</td><td><code>Math.abs(-25)</code></td><td><code>25</code></td></tr><tr><td>Sine</td><td><code>Math.sin_deg(30)</code></td><td><code>0.5</code></td></tr><tr><td>Cosine</td><td><code>Math.cos_deg(30)</code></td><td><code>0.866</code></td></tr><tr><td>Tangent</td><td><code>Math.tan_deg(30)</code></td><td><code>0.577</code></td></tr><tr><td>Arcsine</td><td><code>Math.asin_deg(0.5)</code></td><td><code>30</code></td></tr><tr><td>Arccosine</td><td><code>Math.acos_deg(0.866)</code></td><td><code>30.003</code></td></tr><tr><td>Arctangent</td><td><code>Math.atan_deg(0.577)</code></td><td><code>29.985</code></td></tr></table><p>Note that these trigonmetric functions are custom to the Pond game and all use degrees. The standard JavaScript functions use radians.</p>":
|
||||
"")+(11<=b?"<h3>Random</h3>"+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 132.46497344970703 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 132.46497344970703 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 131.96497344970703 M 131.96497344970703,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">Math.random  (  )</text></g></svg></p>':
|
||||
"js"==a?'<pre class="mathSpec spec">Math.random()</pre>':"")+"<p>This function returns a random fraction from 0.0 to 1.0. To get a random number in a larger range, just multiply it by the maximum value. Here's an example of getting a random angle:</p><pre>var angle = Math.random() * 360;</pre>":"")+"</div>"+(11<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e<h2 id="variables">Variables</h2><div id="variables-content"><h3>Assigning</h3>'+("blocks"==a?'<p><svg height="40" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#844966" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 179.29097747802734 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 155.2165756225586,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPath" fill="#a55b80" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 179.29097747802734 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 155.2165756225586,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPathLight" stroke="#c08ca6" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 178.79097747802734 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 155.7165756225586,5.5 v 27 h -30.155967712402344 M 119.96060791015626,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">var</text><g class="blocklyEditableText" transform="translate(40.37201690673828,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="60.12446594238281"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">name<tspan style="fill: rgb(165, 91, 128);"> \u25be</tspan></text></g><text class="blocklyText" y="12.5" transform="translate(100.4964828491211,10)">=</text><text class="blocklyText" y="12.5" transform="translate(165.2165756225586,10)">;</text><g class="blocklyDraggable" transform="translate(126.06060791015625,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">0</text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="variablesSpec spec">var <i>name</i> = <i>value</i>;</pre>':"")+"<p>Assigns a value (usually a number) to the named variable. The name of the variable should be something that makes sense, such as <code>range</code> or <code>angle</code>.</p>"+("js"==a?"<p>Note that variable names are case-sensitive, thus <code>angle</code> and <code>Angle</code> are two completely different variables. Variable names must only use the English letters a-z, and numbers. Variable names may not start with a number.</p><p>The <code>var</code> keyword may be omitted on all but the first assignment, but there is no harm in using it.</p>":
|
||||
"")+"<h3>Incrementing</h3>"+("blocks"==a?'<p><svg height="41" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#844966" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 157.48308563232422 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 133.40868377685547,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPath" fill="#a55b80" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 157.48308563232422 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 133.40868377685547,5 h -30.155967712402344 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 30.155967712402344 z"></path><path class="blocklyPathLight" stroke="#c08ca6" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 156.98308563232422 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 133.90868377685547,5.5 v 27 h -30.155967712402344 M 98.15271606445313,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(10,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="60.12446594238281"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">name<tspan style="fill: rgb(165, 91, 128);"> \u25be</tspan></text></g><text class="blocklyText" y="12.5" transform="translate(70.12446594238281,10)">+=</text><text class="blocklyText" y="12.5" transform="translate(143.40868377685547,10)">;</text><g class="blocklyDraggable" transform="translate(104.25271606445312,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 28.155967712402344 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 27.655967712402344 M 27.655967712402344,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="18.155967712402344"></rect><text class="blocklyText" y="12.5">1</text></g></g></g></svg></p>':
|
||||
"js"==a?'<pre class="variablesSpec spec"><i>name</i> += <i>number</i>;</pre>':"")+"<p>This is a shortcut for adding a number to an existing variable. There is no difference between the following two lines:</p><pre>angle += 10;\nvar angle = angle + 10;</pre><p>Do not use <code>+=</code> on a variable that has not already been defined. If in doubt, assign the variable to 0 at the beginning of the program.</p><h3>Retrieving</h3>"+("blocks"==a?'<p><svg height="26" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#844966" d="m 0,0 H 70.12446594238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#a55b80" d="m 0,0 H 70.12446594238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#c08ca6" d="m 0.5,0.5 H 69.62446594238281 M 69.62446594238281,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="60.12446594238281"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">name<tspan style="fill: rgb(165, 91, 128);"> \u25be</tspan></text></g></g></svg></p>':
|
||||
"js"==a?'<pre class="variablesSpec spec"><i>name</i></pre>':"")+"<p>Retrieves the value (usually a number) that had previously been assigned to the named variable.</p></div>":"")+(11<=b?'\x3c!-- ---------------------------------------------------------------------- --\x3e<h2 id="functions">Functions</h2><div id="functions-content"><p>TODO</p></div>':"");b=document.getElementsByTagName("h2");a=0;for(var c;c=b[a];a++){var d=document.createElement("img");d.src="../common/1x1.gif";c.insertBefore(d,c.firstChild);
|
||||
c.className="zippy-header-collapsed";document.getElementById(c.id+"-content").className="zippy-content-collapsed";d=u;if(!c)throw TypeError("Element not found: "+c);"string"==typeof c&&(c=document.getElementById(c));c.addEventListener("click",d,!0);c.addEventListener("touchend",d,!0)}});
|
||||