mirror of
https://github.com/google/blockly.git
synced 2026-03-03 20:00:10 +01:00
Automatic commit Sat Jan 11 03:00:02 PST 2014
This commit is contained in:
@@ -42,7 +42,7 @@ Blockly.Python['colour_random'] = function(block) {
|
||||
};
|
||||
|
||||
Blockly.Python['colour_rgb'] = function(block) {
|
||||
// Compose a colour from RGB components.
|
||||
// Compose a colour from RGB components expressed as percentages.
|
||||
var functionName = Blockly.Python.provideFunction_(
|
||||
'colour_rgb',
|
||||
[ 'def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + '(r, g, b):',
|
||||
|
||||
@@ -170,9 +170,9 @@ Blockly.Python['math_number_property'] = function(block) {
|
||||
if (dropdown_property == 'PRIME') {
|
||||
Blockly.Python.definitions_['import_math'] = 'import math';
|
||||
var functionName = Blockly.Python.provideFunction_(
|
||||
'isPrime',
|
||||
'math_isPrime',
|
||||
['def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + '(n):',
|
||||
' # http://en.wikipedia.org/wiki/Primality_test#Naive_methods',
|
||||
' # https://en.wikipedia.org/wiki/Primality_test#Naive_methods',
|
||||
' # If n is not a number but a string, try parsing it.',
|
||||
' if type(n) not in (int, float, long):',
|
||||
' try:',
|
||||
|
||||
Reference in New Issue
Block a user