diff --git a/libraries/SciSnap3Blocks.xml b/libraries/SciSnap3Blocks.xml
index b3565310b..3706f6a27 100644
--- a/libraries/SciSnap3Blocks.xml
+++ b/libraries/SciSnap3Blocks.xml
@@ -1 +1 @@
-Reads a file using the filepicker.Creates a new sprite, a duplicate, or a permanent clone.duplicatepermanent Clone =permanentClone
duplicate
new sprite=newSpritethisSpritethisSprite
anotherSpritespriteNamewhat1existingSpritesSciS_createObject(operation,sprite,spriteName)itemsomething wrong!create new sprite of spriteImports a stored sprite from a file selected with filepicker.Returns "true" if JavaScript is enabled, else "false".errorReturns "true" if the key no. n is pressed, else "false".27Reports date and time in standard notation.day10hour10minute10second10--T::Reports the selected part of the datetime.seconds todayJulian Date
decimal years
days this year
hours this year
minutes this year
seconds this year
hours today
minutes today
seconds todayYYYY17MM54DD21h12m45s7daysi11402Julian Date2JD365.2530.6001172099531121531101215821260360024Input dialog for a list of items. Click item by mouse and then ok. Returns the selected item.thisSpritethisSprite
anotherSpritetitleresult0costumeheight2570widthi1width8 (click on it)costumelightGrayfalsefalse15continuous1blacklightGray (click on it)102018truefalsei1draw2530505false281218truefalsedraw70301005falseok751218truefalseokfalse70100305oktrue0Allows reading global settings programmatically.
Copied from Snap! library.pt:o valor da configuração _
ca:paràmetre _
Stage sizeProject notes
Project name
User
Presentation mode
Language
Zoom blocks
Stage size
Stage scale
Retina display support
Long form input dialog
Plain prototype labels
Input sliders
Execute on slider change
Clicking sound
Turbo mode
Flat design
Keyboard editing
Visible stepping
Thread safe scripts
Prefer smooth animations
Flat line ends
Codification support
Inheritance support
Hyper blocks support
Visible paletteAllows changing global settings programmatically.
This block is for Boolean (checkbox) settings; use
SET VALUE for numeric or text values.
Copied from Snap! library.pt:altera o valor da configuração _ para _
ca:fixa el paràmetre _ a _
Turbo modePresentation mode
Retina display support
Long form input dialog
Plain prototype labels
Input sliders
Execute on slider change
Clicking sound
Turbo mode
Flat design
Keyboard editing
Visible stepping
Thread safe scripts
Prefer smooth animations
Flat line ends
Codification support
Inheritance support
Hyper blocks support
draggabletrueReports the row or column number of the row or column with the name entered, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).columncolumn
rownameSciSnap!Datatable010columnfirstlast1#n0i10i100rowfirstlast1#n0i10i10ERROR: something wrong!row/column ... of ... --> numberReports the row or column name of the row or column with the number entered, or reports an error message.columncolumn
row1SciSnap!Datatable0columnrowEvaluates the predicate with a given parameter.ringified predicateEvaluates the intervals with a given parameter.ringified predicateinterval3<falsefalseimplies -->implies -->
is equivalent to <-->trueis equivalent to <-->ERROR: something went wrong!Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]2resultn11141413<2≤3≤2<3<2<4414142<3≤2≤3<2<3<true323111111111121212121212121211resultn1m1n111resultn1Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]11define left edge and operator44define right edge and operator0listOfIntervalsitemfalseReturns all elements of a list not covered by the predicate.Returns a set only with elements in item 3 not covered by the intervals or the predicate.result3343lst_sort(list, fn)355i132305Returns all elements of a list not covered by the intervals.Test wether the predicate is translatable to a list of intervals.ringified predicate1comparisonOperator1123value32value2falseIntervals should be of structure [leftLimit,operator1,operator2,rightLimit]interval1interval2intersection0result1144341444341444determines intervals1 \ intervals2resultm1n1m1resultintervalresultinterval01predicate12i32<3<intervalsi1Shows the message with headline in the middle of the window.headlinetheMessageReports a vector, built by the items.Returns a new vector of dimension n with random elements.3110Returns a matrix formed from the input vectors.length1transposed?1column-vectorresultvectorReturns a new nxm-matrix with random elements.32110i1Creates the transpose of a vector, matrix, or table.vector or matrix0Determines a property of a matrix or vector.minmin
max
minpos
maxpos
number
sum
mean
median
variance
standard-deviation
softmaxmatrix or vectorchoice1vectordatasoftmaxmedianminmaxnumbersummeanminposposY1maxposposY1variancestandard-deviationstandard-deviationERROR: unknown option!... of matrix or vectorLinear operations with scalars, vectors and matrices.*+
-
*
X-*ERROR: illegal operation between numbers!linear operationvectormatrixERROR: illegal operation with a number!linear operationvectorisAtransposed?column-vectorvectortrue-true*X33trueERROR: illegal vector operation!linear operationmatrix*ERROR: illegal operation!linear operationvector matrix operationERROR: illegal operation!linear operationmatrixvectorERROR: illegal operation!linear operationERROR: the vector should be a column vector!linear operationmatrix vector operationmatrixmatrix matrix operation-*rowERROR: illegal operationlinear operationApplies a mapping matrix to an object that is given as a matrix of points.matrixlist of pointsSolves a linear system of max. 50 equations.matrixcolumn vectorcolumn-vector01bmatrixcreate matrix with attached column bsolvedtrue50columncreate matrix with attached column bdTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonalizer1Reports a list of matrix A in triangle form, the rank of A, column change and column positions.matrix0Aba copy of A is used to let A unchangedrankrow1columchangefalsecolumn positions11i1search downwardsi1search to the rightc0row1row1row-1transform to diagonal form ECalculates the coefficients of the interpolation polynomial for a 2xn-matrix of points.list of points212matrixcreate matrix of powers of x and y-valuesolvedtruen50datai1j-12dTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonaizer1Calculates the value of a polynomial for input x.polynomial as list of coefficients11result12i3Applies an affine transformation to a list of points.
list of points3 original points3 target pointsoktrueP11P22P33Q11Q22Q33S1221221220ERROR: denominator is zeroaffine transformation of ...Reports a complex number in Cartesian form.23Reports a complex number in polar form.230Reports a complex number in polar or Cartesian form.complex numberpolarpolar
CartesianReports properties of complex numbers.real-partabsolute-value
real-part
imaginary-part
phase
conjugatecomplex numberreal-partimaginary-partphaseconjugateERROR: unknown operator!... of complex numberReports arithmetic results of two complex numbers.z1++
-
*
/z2complex-numbercomplex-number-polar-formcomplex-number-polar-form+-*/cnC22333223Creates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15SciS_MathpadAddAxes(costume,properties)myPropertiescostume attributes and line attributes same as SketchPad:
other attributes:
- draw only ponts, not arrows
- dimension of coordinate system
- max. value on scales
- start point of arrowsReports an empty dictionary.This block creates new variables on the selected scope: global (for all sprites), sprite (for this sprite only) or script (only for that blocks stack) with the names given (in 'names' list).
If there is already a variable with that name in that scope, it does nothing: no errors and no overwrites.pt:cria as variáveis _ _
ca:crea les _ variables _
es:crear las _ variables _
de:erstellen _ var _
globalglobal
sprite
scriptReports an RGB-value specified by name, number, tree or four values, or list. Default value is gray.grayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentaRGB-valueRGB-value
RGBA-value4truetruetrueReturns an empty costume of the given width and height with background color given as text or list.400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentaReports true if the varname is part of the scope of the sprite. the varname is not used case-sensitive!varnamethisSpritethisSprite
theStage
anotherSpritevar_names(scope)spriteSets the value of an existing property or inserts it anew.dimensionstypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
MathPad properties={
type of data=typeOfData
draw only points, not arrows=onlyPoints
dimensions
max value on scales=maxValue
min value on scales=minValue
start point for arrows=startPoint
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReturns the value of a property.dimensionstypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
MathPad properties={
type of data=typeOfData
draw only points, not arrows=onlyPoints
dimensions
max value on scales=maxValue
min value on scales=minValue
start point for arrows=startPoint
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for MathPad
position on stage
7: upper offset for MathPad
position on stage
8: close-button properties40030000truefalse15thisSpritethisSprite
theStage
anotherSpriteoffsetsmyPropertiesa simple way to set some MathPad attributes:
1: line width
2: draw only ponts, not arrows
3: dimension of coordinate system
4: max. value on scales
5: start point of arrows1false3-1010-1010-1010000thisSpritethisSprite
theStage
anotherSpriteoldDimensionsdimensionsmyPropertiesoldXmaxxMaxmyPropertiesoldXminxMinmyPropertiesoldYmaxyMaxmyPropertiesoldYminyMinmyPropertiesoldZminzMinmyPropertiesoldZmaxzMaxmyPropertiesoldWithGrid?withGrid?myPropertieslineWidthmyPropertiesonlyPointsmyPropertiesdimensionsmyPropertiesxMinmyPropertiesxMaxmyPropertiesyMinmyPropertiesyMaxmyPropertieszMinmyPropertieszMaxmyProperties321withGrid?myPropertiescostumeWidthcostumeHeightbackColorDraws a vector, complex number, or object of points from the start point stored in the properties.vectorvector
complex-number
line-to
object-ofblackblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentathisSpritethisSprite
theStage
anotherSpritefalsetypeOfDataobject-ofdimensionsmyProperties1SciS_MathpadAddAxes(costume,properties)myPropertiescomplex-numberdimensionsmyProperties21cnPdata23SciS_MathPadPlot(costume,data,color,properties,choice)RGB-valuemyPropertiesSciS_MathpadAddAxes(costume,properties)myPropertiesvectorline-todimensionsmyPropertiescolumn-vectorSciS_MathPadPlot(costume,data,color,properties,choice)RGB-valuemyPropertiesobject-ofDraws members of a set.set1blackblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magenta11thisSpritethisSprite
theStage
anotherSpritesetdimensionsmyProperties115propertiesmyPropertieswidthwidthheightheightxminxMinxmaxxMaxleftOffset1offsetsupperOffset2offsetsdl305level30x0lineColorlineWidthSciS_MathPadPlotSet(set,setname,properties,atY,costume)myProperties20Changes the name of a costume.a costumenew costume nametrueAdds or replaces an entry in a dictionary.Allows changing global settings programmatically.
This block is for numeric or text settings; use
SET FLAG for Boolean (checkbox) values.
Copied from Snap! library.pt:altera o valor da configuração _ para _
ca:fixa el valor de _ a _
Stage sizeProject notes
Project name
Language
Zoom blocks
Stage size
Stage scale
Visible paletteSets a local variable of a sprite to the specified value.varnamethisSpritethisSprite
theStage
anotherSpriteanyValueReports the value of a local variable.varnamethisSpritethisSprite
theStage
anotherSpriteERROR: variable don't exist.get ... of spriteThis block deletes all the variables with the names given (inside input list).
Each name will make only one variable deletion, and this will be the variable found following the scope order: 'script' -> 'sprite' -> 'global'.
If we have a "testing" sprite variable and also a "testing" global one, deleting "testing" will delete only the sprite one (Yes! we can also do "delete var (testing, testing)" to delete both.
If one variable does not exists (in any scope) an error happens, stopping block action in that point. You can check it before with the "does var (name) exists?"block. pt:remove as variáveis _
ca:esborra les variables _
es:borrar variables _
de:löschen var _
Reports the value assigned to the key.Replaces the value assigned to the key with a new value.Removes the entry of a key.Reports the content of a selected file.Stores a dictionary as a JSON file.filenamefilename
filepickerJSONReports a copy of a costume.a costumeReports the costume of a sprite or the stage.thisSpritethisSprite
theStage
anotherSpritecostumeDisplays a list in a dialog window.This command closes all open dialog windows in a brutal way. ;-)errorCatch errors.
Runs the first script. If it succeeds, nothing else happens.
But if it has an error (something that would otherwise result
in a red halo around the block), then the second script is run,
with the text of the error message that would have been shown in the variable ERROR.pt:tenta executar _ e, em caso de erro _ , executa _
ca:prova de forma segura _ i si _ _
Reports the current layer of a sprite.Sets the layer of a sprite.0Selects the specified costume for the cursor.pointerauto
cell
copy
crosshair
default
grab
grabbing
help
move
not-allowed
pointer
progress
text
wait
zoom-in
zoom-out
n-resize
s-resize
e-resize
w-resize
ne-resize
se-resize
nw-resize
sw-resizeTest on vector, matrix, table, predicate, interval, list of intervals, set, dictionary or complex-number.vectorvector
row-vector
column-vector
matrix
table
dictionary
complex-number
complex-number-Cartesian-form
complex-number-polar-form
set
comparisonOperator
interval
listOfIntervals
numericalListvectorcolumn-vectorrow-vectorcolumn-vectormatrix1SciS_isType(data,selection)matrixtable1SciS_isType(data,selection)tabledictionary01keyvaluetable12intervalfalsecomplex-numbercomplex-number-Cartesian-formcomplex-number-polar-formlistOfIntervalstrueset234listOfIntervals55numericalListresult0falsefalseReturns a random number between 0 and 1.Reports Pi.Reports Euler's number.The factorial function.Reports a binomial coefficient.531result1n1i1Rounds value x to n digits.1.23572Reports a string with replacement instead of substring.allall
firstthisthatthisStringReports the index of first appearance of substring in string.ringthisStringReturns a root of an equation calculated with Newton's method.ringified term1epsilon0.00001i11000Reports an element of a sequence.ringified term1Returns a list of the first n elements of a sequence.1ringified term1Returns a list of secant slopes calculated with the given sequence.ringified term21/n1/nelementReports the secant slope "nearby" the given point.ringified term1epsilon0.00001Returns a finite sum.10ringified term0result0iReturns the integral of a term calculated with n trapezoids.2ringified term11000dxx11Reports either
- data Fourier transformed to frequency-space
- "raw" FFT (Fast Forier Transformation) data formatted as SciSnap! complex numbers
- or iFFT real datafrequency_spectrumfrequency_spectrum
complex_FFTdata
iFFT_of_FFTdata100iFFT_of_FFTdataSciS_FFTops(data,freq,choice)Reports coefficient of the binomial distribution b(N,p,k)=(N choose k)*p^k(1-p)^(N-k)100.12ERROR: wrong parameter!b(...)Reports binomial distribution B(N,p,k).1100.1ERROR: wrong parameter!B(...)Reports coefficient of the hypergeometric distribution.10352ERROR: wrong parameter!h(...)Reports hypergeometric distribution.11035ERROR: wrong parameter!H(...)Reports coefficient of the Poisson distribution.0.052ERROR: wrong parameter!p(...)Reports Poisson distribution.20.05ERROR: wrong parameter!P(...)Reports coefficient of the Pareto distribution.132Reports coefficient of the normal distribution.101The empty set.The real (computer-) numbers.Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.230Creation of a set by one numerical interval.
Predicates and elements should be defined by other blocks.
Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.-Infinity-Infinity≤≤
<≤≤
<InfinityInfinitysettrueCreation of a set by a predicate.
Intervals and elements should be defined by other blocks. If possible the predicate is translated to a list of intervals.
Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.ringified predicatepredicateTreeReports whether "element" is element of "set".elementsetsetReports the intersection, union, difference, or cross product of two sets.set1∩∩
∪
\
Xset2are these two sets?set∪∩4044455555\444interval list of set1 and nor covered from interval list of set25If set2 has a predicate, we have to transform the interval list of set1 into a predicate.Xset2233Is set1 subset of set2?set1set2are these two sets?set555intervalelement3Compare elementstrueAre theses two sets equal?set1set2setReports up to n elements of a set. Numers are natural numbers smaller than maxSetValue in SciSnap!-properties.10setresult3405i1maxSetValue should be close to infinity ;-)resultvalueindexlistclean up1Reports the enumerated elements and numbers written as intervals of the set.elementselements
intervals
predicatethis setelementsintervalspredicatetrueReturns the value of the left or right edge of an interval.leftleft
rightReports simple types, sets and lists as string.5i1maxSetValue should be close to infinity ;-)elementsvalueindexlist20item18is first elementtrueitem18ERROR: no simple type!elements --> textConverts a string to a list of elements.1,2,[3,4],{6,7,8..12}]10]0]0}10}0}0find listsReturns an empty table.Reports the copy of a list or an empty list.table or listType conversionstable or listCSVDATAASTEXT
CSV
JSONReports a new table initialized with value.23a valueresultReports a table with labeled columns.23i1rowERROR: labels required!new ... table with labelsReports randomly distributed points in the form of a rectangle, circle, or ring.100-100100-100100squaresquare
circle
ringcircleringCreates new random data in the specified ranges swaying by a straight.10-55102Generates a list of points "near" a given graph.20-552Reports the row or column of a table identified by number or name, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).rowrow
columnnumberOrNamefirst
last
numberOrNameSciSnap!Datatruechoice1tablerowlast1columnlast11ERROR: something wrong!row/column of dataAdds a row, a column, or column headers to a table.rowrow
column
column-headersa listSciSnap!Datachoice1tablerowi1column0i1column-headersi11Deletes a row or column of a table. identified by number or name, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).rowrow
columnnumberOrNamefirst
last
numberOrNameSciSnap!Datatablerowlastcolumnlast11itemReports the element a position x|y of a table, identified by numbers or names.numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001Replaces the value at position x|y of a table.numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001Reports the columns from row startnr to row endnr.SciSnap!DatanumberOrNamelastlast
numberOrNametablelaststartnrrowendnrrowcolNumbersitemSciS_columncopy(data,cols,start,stop)Reports a subsection of an image or table.RGB-datatable-data
matrix-data
list-data
RGB-data
FITS-dataSciSnap!DatanumberOrNamenumberOrNamenumberOrNamenumberOrNamelist-dataresultdummyvalueindextable-datamatrix-datab1columnb2rowe1columne2rowbeginendSciS_subsection(data,begin,end)RGB-dataFITS-dataRGB-datawidthwidthheightheightFITS-datawidthwidthheightheightbeginendSciS_subsectionImage(data,begin,end,width,height)Determines the rows of a table with certain properties.SciSnap!DatanumberOrNameless-thanless-than
greater-than
equal-to
different-fromtablencolumn11op1less-thangreater-thanequal-todifferent-fromcounts the appearances of the values of a list or table.a table or listReports a sorted list.a listreturns the entropy of a list of dataa table or listCopy of corresponding Snap!-library-block:
Reports a new list whose items are the same as in the input list, except that if two or more equal items appear in the input list, only the last one is kept in the result.SciSnap!DatatableNormalizes a table by dividing it by the specified value.SciSnap!Datameanmean
max
number
sum
median
softmaxchoice1vector0Reports a vector or matrix with compressed columnsonly columns .SciSnap!Data2isMatrixmatrixvector11resulti11iresultcolumnNr11Pooling operation with matrices, images and vectors. On the top of the result are the new dimensions.maxmax
meanSciSnap!Data21typeOfPooling1matrixvectorFITSRGBmatrixFITSRGBSciS_pooling(data,width,height,typeOfPooling,stride,typeOfData)Sorts a list or table.SciSnap!DatanumberOrNametruetrueisTabletable1result1Determines a group of properties of a table.meanmin
max
number
sum
meannumberOrNameSciSnap!DatanumberOrNametruetablegroupcolumncolumn11valuecolumncolumn11choice1copytrue0SciS_groupeddata(aTable,compaircolumn,operation,groupcolumn)Calculates the ranges, the covariance or the correlation between two columns of a table.
rangesranges
covariance
correlationnumberOrNamenumberOrNameSciSnap!Datatruetablencolumn11mcolumn11copychoice11SciS_propertiesoftable(selection,table,x,y)1Calculates the parameters of a regression line.SciSnap!DatamatrixsumX0sumY0numerator0denominator0dummymeanXmeanYdummymbDetermines the next k neighbours of a point in data. The classes of the points have to be in column 3. Reports a list with columns x, y, distance, class.52-dim pointSciSnap!Datatablepoint2neighbors3truetruetable-data114Applies a convolution to a table with FITS, RGB, or table values.a kerneltableimage
tableSciSnap!Data100100matrixSciS_convolution(kernel,data,width,height,typeOfData,mIndex,kWidth)Custering of n-dimensional data with k-means-method. Cluster numbers are attached to the data.3SciSnap!DatamatrixSciS_k-means-clustering(k,data)Custering of n-dimensional data with k-means-method. A metric has to be delivered as a ringified term. Cluster numbers are attached to the data.3SciSnap!Dataringified operatormatrixresultadd cluster number 0 to datadimension1minmaxi1calculate min and max for all columnscentersi1choose k random centerscalculate min and max for all columnsanyChangestruen0anyChangesfalsedummycenter1pointbuild clustersadjust centerslabels of data: -1 not visited, 0 visited, -2 noise, >0 clusternrSciSnap!Data505matrix2SciS_DBSCAN(data,r,minMembers)-1reports an ID3 decision tree constructed on the base of labeled dataSciSnap!Datatablewrong data0empty datasetSciS_ID3Tree(data)returns the class of a dataset using an ID3-decision-treedatathis ID3-treecompareData1leaf1leaf (unambiguous)1nodei1ERROR: no sensefull data to compare found!Creates a new empty costume of the specified size and color and sets the local properties.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
whitered
orange
yellow
green
cyan
blue
magentafalsefalse15scalesXprecision2myPropertiesscalesYprecision2myPropertiesscalesXtextheight12myPropertiesscalesYtextheight12myPropertiesscalesXintervals6myPropertiesscalesYintervalsmyPropertiesscalesXstart-10myPropertiesscalesYstart-10myPropertiesscalesXstep2myPropertiesscalesYstep2myPropertiesscalesXscaling1myPropertiesscalesYscaling1myPropertiesscalesTiclength6myPropertiesscalesXminitics0myPropertiesscalesYminitics0myPropertiesscalesXgridfalsemyPropertiesscalesYgridfalsemyPropertiesscalesXcenteredfalsemyPropertiesscalesYcenteredfalsemyPropertiesscalesShowXscaletruemyPropertiesscalesShowYscaletruemyPropertiesplotBordertruemyPropertiesCostume attributes and line attributes same as SketchPad.
other attributes:
plots
marker properties:
1: marker style
2: marker width
3: marker connected
4: marker color red
5: marker color green
6: marker color blue
data properties:
1: minValue
2: maxValue
3: columns
4: rows
scale offsets:
1:left offset
2: right offset
3: upper offset
4: lower offset
labels:
1: title
2: x label
3: y label
4: title height
5: x label height
6: y label height
7: x unit
8: y unit
ranges:
1: x left
2: x right
3: y lower
4: y upper
scale properties:
1: scales x precision
2: scales y precision
3: scales x textheight
4: scales y textheight
5: scales x intervals
6: scales y intervals
7: scales x start
8: scales y start
9: scales x step
10: scales y step
11: scales x scaling
12: scales y scaling
13: scales ticlength
14: scales x minitics
15: scales y minitics
16: scales x grid
17: scales y grid
18: scales x centered
19: scales y centered
20: scales show x scale
21: scales show y scale
22: plot borderReports whether the sprite is configured as a PlotPad.thisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
plots
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
marker properties={
marker style=markerStyle
marker width=markerWidth
marker connected=markerConnected
marker color=markerColor
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
}
scale offsets={
left offset=scaleLeftOffset
right offset=scaleRightOffset
upper offset=scaleUpperOffset
lower offset=scaleLowerOffset
}
labels={
title=title
x label=xLabel
y label=yLabel
title height=titleHeight
x label height=xLabelHeight
y label height=yLabelHeight
x unit=xUnit
y unit=yUnit
}
ranges={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
scale properties={
scales x precision=scalesXprecision
scales y precision=scalesYprecision
scales x textheight=scalesXtextheight
scales y textheight=scalesYtextheight
scales x intervals=scalesXintervals
scales y intervals=scalesYintervals
scales x start=scalesXstart
scales y start=scalesYstart
scales x step=scalesXstep
scales y step=scalesYstep
scales x scaling=scalesXscaling
scales y scaling=scalesYscaling
scales ticlength=scalesTiclength
scales x minitics=scalesXminitics
scales y minitics=scalesYminitics
scales x grid=scalesXgrid
scales y grid=scalesYgrid
scales x centered=scalesXcentered
scales y centered=scalesYcentered
scales show x scale=scalesShowXscale
scales show y scale=scalesShowYscale
plot border=plotBorder
pretty formated=pretty
y-axis starts with 0=start0
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
plots
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
marker properties={
marker style=markerStyle
marker width=markerWidth
marker connected=markerConnected
marker color=markerColor
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
}
scale offsets={
left offset=scaleLeftOffset
right offset=scaleRightOffset
upper offset=scaleUpperOffset
lower offset=scaleLowerOffset
}
labels={
title=title
x label=xLabel
y label=yLabel
title height=titleHeight
x label height=xLabelHeight
y label height=yLabelHeight
x unit=xUnit
y unit=yUnit
}
ranges={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
scale properties={
scales x precision=scalesXprecision
scales y precision=scalesYprecision
scales x textheight=scalesXtextheight
scales y textheight=scalesYtextheight
scales x intervals=scalesXintervals
scales y intervals=scalesYintervals
scales x start=scalesXstart
scales y start=scalesYstart
scales x step=scalesXstep
scales y step=scalesYstep
scales x scaling=scalesXscaling
scales y scaling=scalesYscaling
scales ticlength=scalesTiclength
scales x minitics=scalesXminitics
scales y minitics=scalesYminitics
scales x grid=scalesXgrid
scales y grid=scalesYgrid
scales x centered=scalesXcentered
scales y centered=scalesYcentered
scales show x scale=scalesShowXscale
scales show y scale=scalesShowYscale
plot border=plotBorder
pretty formated=pretty
y-axis starts with 0=start0
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: front color
5: left offset for plot
position on stage
6: upper offset for plot
position on stage
40030000thisSpritethisSprite
theStage
anotherSpriteStageSets the labels and textheights of the diagrams of a PlotPad and redraws them.thisSpritethisSprite
theStage
anotherSpriteDiagram Title18x-label16y-label16titlexLabelyLabeltitleHeightxLabelHeightyLabelHeighta simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color red
4: line color green
5: lineColor bluecontinuouscontinuous
dashed
dash-dot
dot-dot
rainbow
inverse-rainbow1thisSpritethisSprite
theStage
anotherSpritelineStylelineWidthlineColora simple way to set some net attributes:
marker properties:
1: marker style
2: marker width
3: marker connected
4: marker color red
5: marker color green
6: marker color bluesquarenone
o_circle
._point
+_plus
x_ex
square
triangle5falsethisSpritethisSprite
theStage
anotherSpritemarkerStylemarkerWidthmarkerConnectedmarkerColorSets some properties for scales and redraws them.2212121010thisSpritethisSprite
theStage
anotherSpritefalsescalesXprecisionscalesYprecisionscalesXtextheightscalesYtextheightscalesXintervalsscalesYintervalsscalesXstartxLeftscalesXstepxRightxLeftscalesXintervalsscalesXscaling1scalesXminitics1scalesYstartyLowerscalesYstepyUpperyLowerscalesYintervalsscalesYscaling1scalesYminitics1Sets the distances of the diagram axes to the edges of the Sketchpad.thisSpritethisSprite
theStage
anotherSpriteupperOffset1scalesXtextheighttitle0scalesTiclength0lowerOffset1scalesXtextheightscalesYcenteredrightOffset1.5scalesYtextheightscalesTiclength0leftOffset1scalesYtextheightscalesXcenteredscalesTiclength0scaleLeftOffsetscaleRightOffsetscaleUpperOffsetscaleLowerOffsetSets the ranges for the axes of the diagrams of a PlotPad and redraws it..-1010-1010false0.1thisSpritethisSprite
theStage
anotherSpriteprettyDraws the graph of a function given as rigified Snap!-function or coefficient-list of a polynomial. ringified operator or polynomialthisSpritethisSprite
theStage
anotherSpritevectorSciS_addGraphToPlotpad(costume,properties,aFunction,proc)myPropertiesoldPlotsplotsisNewtrueentryDraws the data points of a two-dimensional table with numerical values. With a lot of additions from Rick Hessman. Thanks!myDatathisSpritethisSprite
theStage
anotherSpritemyDatamatrix12SciS_addNumericDataplotToPlotPad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws the data points of a two-dimensional table with numerical values in column 2.
Text values should be used to set the x-label.myDatatruetruethisSpritethisSprite
theStage
anotherSpritemyDatatableSciS_addMixedDataplotToPlotPad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws a histogram of histogram data.With a lot of additions by Rick Hessman. Thanks!myData10thisSpritethisSprite
theStage
anotherSpritetruemyDatavector0costumestart0transposed-vectorminmaxdeltah2resulti1221i1histgramData0prettySciS_addHistogramToPlotpad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws and labels the axes of a PlotPad.
With lot of additions of Rick Hessman. Thanks!thisSpritethisSprite
theStage
anotherSpriteClears the plot area of a PlotPad.plotAreaplotArea
plotData
costumethisSpritethisSprite
theStage
anotherSpriteoldFillColorfillColorfillColorbackColorplotAreacostumeplotDatafillColorRestores the last plotson the PlotPad.thisSpritethisSprite
theStage
anotherSpriteplotplots1numericData1mixedData1histogramSets the ranges to "pretty" values. Many thanks to Rick Hessman!thisSpritethisSprite
theStage
anotherSpriteprettyxLeftxRightscalesXintervalsget dictionary of pretty x-values.scalesXstartstartscalesXstepstepscalesXscalingscalingscalesXintervals6scalesXtextheightscalesXprecisionprecisionscalesXminiticsminiticsxLeftstartxRightstopprettyyLoweryUpperscalesYintervalsget dictionary of pretty y-values.scalesYstartstartscalesYstepstepscalesYscalingscalingscalesYintervals8scalesYtextheightscalesYprecisionprecisionscalesYminiticsminiticsyLowerstartyUpperstop"Pretty" scaling from Rick Hessman. Many thanks!-1010620002000Numbers are too big for pretty printing.nintpretty0.0010.0020.0050.010.020.050.10.20.512510205010020050010002000between91341341341341341341places33322211100000000000sign2index1i21dticnintresultdeltanstartstart*scaling is the actual starting value (start is the value displayed next to the tic)stop1stepstep*scaling is the actual stepping value (step is the difference between the tic labels).scalingintervalsprecisionminiticsthisSpritethisSprite
theStage
anotherSpritemyData0.1myData2dy43xLeft1xRight2yLower3yUpper4scalesXstart1scalesXstep21scalesXintervalsscalesXscaling1scalesXminitics1scalesYstart3scalesYstep43scalesYintervalsscalesYscaling1scalesYminitics1Calculates the ranges of two columns of a table.
Conversion of coordinates.100xpxp
yp
x
ythisSpritethisSprite
theStage
anotherSpritediagramWidthscaleLeftOffsetdiagramHeightscaleLowerOffsetscaleUpperOffsetx0xLeftxLeftxRighty0yUpperyUpperyLowercoordinate1xpypxyObtaining coordinates of a PlotPad at mouseposition.costume-coordinatescostume-coordinates
graph-coordinatesthisSpritethisSprite
theStage
anotherSpriteselection1targetCostumetargetCostumeWidthtargetCostumeHeighttargetXPositiontargetYPositiontargetSizecostume-coordinatescostume coordinates.graph-coordinatescostume coordinates.400300continuouso_circle0400300continuous00600400continuousnone
continuous
dashed
dash-dot
dot-dot
rainbow
inverse rainbowsquarenone
o_circle
._point
+_plus
x_ex
square
triangle0thisSprite0.07thisSpritethisSprite18161615thisSpritethisSpriteChanges the spritename.thisSpritethisSprite
anotherSpritenew nameSciS_changeSpritenameTo(sprite,newName)Reports a list of sprites with similar names. Used when "cleaning up".thisNameChecks whether an element is anywhere in a list.this valuefalseCreates SQL variables and sets some properties.Establishes connection and sets the corresponding properties. Change parameters if necessary. connectionhttps://snapextensions.uni-goettingen.de/mysqlquery.php?server=db1&user=snapexuser&password=snap!userconnection&type=connect12ok0115ERRORReports a list of databases on the server and sets the corresponding properties.databasesconnection&type=getDBs000115ERRORSelects one of the databases and sets the corresponding properties.2databasescurrentDatabasedatabasesdummyconnection&command=USE currentDatabasetablestablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERRORReports a list of tables of the chosen database and sets the corresponding properties.tablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERRORSelects one of the tables and sets the corresponding properties.1tables0115ERRORReads the attributes of the specified table and sets the corresponding properties.1tables0115ERRORGenerates a simplified SQL query.*
DISTINCTi11result FROM 0result2Generates an almost complete SQL query.*
DISTINCTASCASC
DESC10i11result FROM 0result20result20resultASCExecutes an SQL query.1:ERRORreplaces "%" with "%25" to prevent trouble with the url-block.resultconnection&type=query&query=&database=currentDatabaseImports the results of an SQL-query to SQLData and sets the corresponding properties.typeOfDatatable0minValuenot setmaxValuenot setReturns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL value.Returns an SQL value.Returns an SQL value.Returns an SQL value.Returns an SQL value.Partly copied von Brian Harvey's manual.Inspired by the "drip painting" of Jackson Pollock. ;-)005050-3020redblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magenta100thisSpritethisSprite
anotherSprite
theStagedx100dy100costumecolorRGB-valueSciS_drip(xa,ya,width,height,dx,dy,color,costume,n)Creates a list of the specified length, filled with the specified entry.10anythingInspired by Jackson Pollock ;-)StageStage220200225Creates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15Costume attributes and line attributes same as SketchPad.
other attributes:
data properties:
minValue
maxValue
columns
rows
mean of values
stddev of values
image properties:
image type (RGB,FITS)
imageWidth
imageHeight
imageRealSize
Reports whether the sprite is configured as an ImagePad.thisSpritethisSprite
theStage
anotherSpriteReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
mean value=mean
standard deviation=stddev
}
image properties ={
image type=imageType
image width=imageWidth
image height=imageHeight
image real size=imageRealSize
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
mean value=mean
standard deviation=stddev
}
image properties ={
image type=imageType
image width=imageWidth
image height=imageHeight
image real size=imageRealSize
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: left offset for Image
position on stage
4: upper offset for Image
position on stage40030000thisSpritethisSprite
theStage
anotherSpriteStagea simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color
4: fill colorcontinuouscontinuous
dashed
dash-dot
dot-dot1thisSpritethisSprite
theStage
anotherSpritelineWidthlineStylelineColorfillColorif source is not SciSnap!Data data should have the image dimensions in the last row as (width,height,"dimensions").SciSnap!DataSciSnap!Data
currentCostume
anotherListthisSpritethisSprite
anotherSprite
theStageSciSnap!DatacurrentCostume013dimensionstypeOfDataRGBcolumns4imageWidth1imageHeight2myDatamyDatarowsmyDataminValueminmyDatamaxValuemaxmyDatameanmeanmyDatastddevstandard-deviationmyDatatypeOfDataFITSimageWidth1imageHeight2myDatamyDatarowsmyDatacolumns1minValueminmyDatamaxValuemaxmyDatameanmeanmyDatastddevstandard-deviationmyDataERROR: oops...anything went wrong!import image dataGenerates, adds or mixes an image (with offsets) from the FITS or RGB data (placed in myData) in different colors.createcreate
add
mixgraygray
red
green
blue
false-color
RGBfalse255255
0thisSpritethisSprite
anotherSprite
theStagetypeOfDataFITStypeOfDataRGBmyDatacolor1selection1RGBtypeOfDataRGBcreateoffsetstheStageStageimageWidththeStage2StageimageHeighttheStage2offsets00costumeWidthcostumeHeightSciS_addImageToImagePad(data,properties,color,log,alpha,pixels,selection)myDatamyPropertiesStageDraws a list of "points" in different "shapes". myDatacirclescircles
squares5thisSpritethisSprite
theStage
anotherSpritefalsefalse20sourcemyDatamatrix012source121lastvalueSciS_drawListOfPoints(costume,data,shape,size,properties,withNoise,range)myPropertiesSets the RGB or image data value at (x|y) on costume or myData of target. RGBRGB
image data in myDatathisSpritethisSprite
theStage
anotherSpritean appropriate valuefalsepositionx1y2vectorRGB34vectorlineColor1thisSpritefalsetrueReports the RGB value at the position (x|y) of the costume. RGB(A)RGB(A)
image data of myData =imageDatathisSpritethisSprite
theStage
anotherSpritefalsepositionx1y2costumeWidthcostumeHeight11RGB(A)typeOfDataRGBtypeOfDataFITSObtaining data with the mouse from an image stored in myData.imageValueimage value=imageValue
RGB value=RGBvalue
costume coordinates=costumeCoordinates
slice values from costume=costumeSlice
slice values from myData=dataSlice
line data=lineData
circle data=circleData
brightnessthisSpritethisSprite
theStage
anotherSpritefalseselection1isDraggabletargetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.imageValueimage value.11RGBvalueRGB value.11lineDataokfalseokfalsexold1yold2Stagedraggableline datacostumeSlicedataSliceslice datacircleDatacircle dataokfalseokfalseStagebrightnessbrightnessERROR: unknown selectionimageValue/... on ... by mouseApplies an affine transformation to a costume.
currentCostumefalseoktrueP11P22P33Q11Q22Q33S1221221220ERROR: denominator is zeroaffine transformation of costume ...Reports the brightness of a FITS or RGB image around x|y in a circle with radius r.
Attention: JS-coordinates are used!10myDatamyData
costumethisSpritethisSprite
theStage
anotherSpritefalsemyDatatypeOfDataFITStypeOfDataRGBSciS_brightness(data,xpos,ypos,r,width,height,typeOfData,typeOfArea)typeOfDatacircleRemoves the calling sprite.thisSpritethisSprite
anotherSpriteSciS_removeSprite(sprite)Selects a sprite as active.thisSpritethisSprite
theStage
anotherSpriteThis block is called by dynamically generated event handlers. You should define what is to happen for the corresponding sprites. Two examples are included for the LineTool and the SquareTool.thisSpritethisSprite
theStage
anotherSpritereceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessage110SquareToolTheNewSpritereceiveKey -20receiveInteraction clickedArthmetic with image data (FITS or RGB).
RGB data are normalized to the range 0 ..255.
The last element of the result contains the dimensions of the imagge.of image1100100++
-
*
/of image210010000imageType1vectorFITSmatrix1314RGBunknownunknownimageType2vectorFITSmatrix1314RGBunknownunknownunknownunknownSciS_imageArithmetic(image1,image2,imageType,xOffset,yOffset,width1,height1,width2,height2,operation)Configure the sprite as an ImagePad and load an image as costume!valuediagramAn image of Albategnius should be loaded as costume of the sprite!t0a0.1225positionStagecircles2theStagetruetrue100t1Creates an Infobox about this category. thisSpritethisSprite
theStage
anotherSpriteanotherSpriteanotherSprite
theStage
thisSprite1Stage size2Stage sizemyImagescurrentImagemyLineToolnot setmySquareToolscostumeWidthcostumeHeightthisSpritethisSprite
theStage
anotherSpriteaddadd
removethisSpritethisSprite
theStage
anotherSpritetruenextnext
first
last
any number = numberthisSpritethisSprite
theStage
anotherSpritetruemyImages1myImages0myImagesmyImageslightGraycurrentImagelightGraythisSpritethisSprite
theStage
anotherSpritelightGraycurrentImagethisSpritethisSprite
theStage
anotherSprite25currentImagenew sizecurrentImage5currentImagethisSpritethisSprite
theStage
anotherSprite1010currentImageimagecurrentImagethisSpritethisSprite
theStage
anotherSpritecurrentImageisDraggableoldMouseXoldMouseYStage coordinates are alternatively described as Snap! or JavaScript coordinates, window and image coordinates are always JavaScript coordinates.window-positionwindow-position
image-position
image-valuethisSpritethisSprite
theStage
anotherSpritefalsewindow-positionimage-positionimage-valueimageOffsetscurrentImageStageStagecurrentImageimageSizecurrentImage100NaNxi11yi22image-positionERROR: wrong selection!stage position --> ...Stage coordinates are alternatively described as Snap! or JavaScript coordinates, window and image coordinates are always JavaScript coordinates.window-positionwindow-position
image-positionthisSpritethisSprite
theStage
anotherSpritefalseselection1window-positionimage-positionimageSizecurrentImage100NaNimageOffsetscurrentImageStageStagecurrentImageresult1currentImageStage2StagecurrentImagethisSpritethisSprite
theStage
anotherSpriteposition1122Checks whether the specified sprite is in the list of deleted sprites.thisSpritethisSprite
anotherSpriteallTheSpriteserrorAttaches a sprite as part of another sprite.a partthisSpritethisSprite
anotherSpriteInitialization of SciSnap!800600EmptyHilbertoRight00Hi!2Creates a text-file "SciSnap!Costumes" from present costumes.data""itemTEXTSciSnap!CostumesSciSnap!CostumesCreates and stores different SciSnap! costumes.ready!1Creates global variables "SciSnap!Properties", "SciSnap!Data", and "SciSnap!Messages".
Sets the default values of global SciSnap!-properties for items
typeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueSets the value of an existing property or inserts it anew.typeOfDatatypeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueReturns the value of an existing global SciSnap!-property or "".
Items:
typeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueminValuetypeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueCreates a new empty costume of the specified size and color and sets the local properties.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalseleft
right15StagetypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesfillColor180180180myPropertiestextHeight12myPropertiestextOrientationtruemyPropertieswithCloseButtonmyPropertiescloseButtonLeftmyPropertiescloseButtonSizemyPropertiesbackColormyPropertiesfrontColor000myPropertiescostumeWidthmyPropertiescostumeHeightmyPropertieswidthmyPropertiesheightmyPropertiesoffsets22myPropertiescostume properties:
1: width
2: height
3: back color RGB
4: offsets for position on stage
5: front color RGB
line properties:
1: line width
2: line style
3: line color RGB
4: fill color RGB
text properties:
1: text height
2. orientation (horizontal=true)
closebutton properties:
1: with closebutton?
2: position (left=true)
3: closeButtonSizeTest on different SketchPad types.thisSpritethisSprite
theStage
anotherSpriteSketchPadSketchPad
MathPad
PlotPad
ImagePad
GraphPad
NNPad
GridPadmyPropertiesfalseReshapes and cleares the costume of a SketchPad.thisSpritethisSprite
theStage
anotherSprite400300SketchPadcostumeWidthmyPropertiescostumeHeightmyPropertiesoffsetsmyProperties22fillColorthisSpritebackColortheStagedrawStage2Stage2Stage2Stage2theStagefalsefillStage2Stage2Stage2Stage2theStagefalseDeletes a SketchPad.thisSpritethisSprite
anotherSpriteIf necessary, place the close button in the correct position.thisSpritethisSprite
anotherSpriteSketchPadmyCloseButtonnot setwithCloseButtontypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesdraw00false00false00false12222myCloseButtonThis block is used to create/remove dynamically tools for a window.createcreate
removelineline
a squarethisSpritethisSprite
theStage
anotherSprite30callerlineCreate or remove TheLineTool with its ends.myWindowTheLineToolisMovingTheLineToolfalseTheLineToolyellowreceiveInteraction pressedTheLineToolreceiveInteraction mouse-departedTheLineToollineEnd1newSpritethisSpriteLineEnd1LineEnd1isMovingLineEnd1falseLineEnd1SciS_changeToolCostume(size,tool,color)lineEnd1orangeRGB-value44receiveInteraction pressedLineEnd1receiveInteraction mouse-departedLineEnd1myLineEnd1TheLineToollineEnd2newSpritethisSpriteLineEnd2LineEnd2isMovingLineEnd2falseLineEnd2SciS_changeToolCostume(size,tool,color)lineEnd1magentaRGB-value44receiveInteraction pressedLineEnd2receiveInteraction mouse-departedLineEnd2myLineEnd2TheLineToollineColoryellowRGB-valuelineWidth2LineEnd1window-positiontrueLineEnd2window-positiontruefalseLineEnd2TheLineToolmyLineToolnot seta squaremySquareToolsmyWindowisActivefalse200SciS_changeToolCostume(size,tool,color)squareToolorangeRGB-valuereceiveInteraction pressedreceiveInteraction mouse-departedreceiveKey +receiveKey -receiveKey up arrowreceiveKey down arrowreceiveKey left arrowreceiveKey right arrowCreate or remove a SquareTool.showshow
hideTheLineToolTheLineTool
TheSquareToolthisSpritethisSprite
theStage
anotherSpriteTheLineTooltoolTheLineToolshowTheLineToolLineEnd1LineEnd2lineColoryellowRGB-valuelineWidth2LineEnd1window-positiontrueLineEnd2window-positiontruefalseLineEnd2TheLineToolTheSquareTooltoolTheSquareToolshowMoves tools to new positions corresponding to their image coordinates.thisSpritethisSprite
theStage
anotherSpriteTheLineToolLineEnd2TheLineToolshowTheLineToolTheSquareToolthisSpritethisSprite
theStage
anotherSpriteTheLineToolsquareToolmySquareToolsLineToolLineTool
SquareToolleftleft
right
up
downSquareToolleftTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolrightTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolupTheLineToolLineEnd2showTheLineToolmyWindowTheLineTooldownTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolCancels the connection between attached sprites.thisSpritethisSprite
anotherSpriteAdds an event handler to a sprite. Resets the event handler with the standard sprite operation if the script is empty.mouseClickLeftmouseDownLeft
mouseDownRight
mouseClickLeft
mouseClickRight
mouseDoubleClick
mouseEnter
mouseLeave
mouseEnterDragging
mouseLeaveDragging
mouseEnterBounds
mouseLeaveBounds
mouseMove
mouseScrollReports a string without first/all instances of substring.allall
firstthisthisStringReports a substring of a string.thisString14Deletes leading and trailing as parameter defined characters in a string...this string...0Reports the Euclidean distance of to points.Metric for Strings.SaturdaySundayDeletes any "remaining" close buttons.Sets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets for Image position=imageOffsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
1: text height=textHeight
2. orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}thisSpritethisSprite
theStage
anotherSpriteReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets for Image position=imageOffsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
1: text height=textHeight
2. orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}thisSpritethisSprite
theStage
anotherSpriteDraws a line on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.thisSpritethisSprite
theStage
anotherSpritefalseposition1position2Draws a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.drawdraw
fillthisSpritethisSprite
theStage
anotherSpritefalseposition1position2Draws or fills a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.drawdraw
fill20thisSpritethisSprite
theStage
anotherSpritefalseposition1Draws a text on present costume using line properties. The text is drawn horizontal or vertical. Coordinates can be used as Snap! or JS coordinates.my text12thisSpritethisSprite
theStage
anotherSpritefalseposition1Reports the width of the text, if drawn on a Sprite.my text18thisSpritethisSprite
theStage
anotherSpritei515025-2402Returns the content of a TEXT, CSV, RGB, JSON or FITS file from a URL. RGB-data should have the dimensions in the last row, otherwise use CSV.TEXTTEXT
CSV
RGB
JSON
FITSthis urlTEXTCSVRGBJSONFITSReturns the content of a TEXT, CSV, RGB, JSON or FITS file, selected with filepicker. RGB-data should have the dimensions in the last row, otherwise use CSV.TEXTTEXT
CSV
RGB
JSON
FITSTEXTTXTCSVRGBCSVJSONJSONFITSFITSFTSReturns a list with one or more elements consisting of [filename/BLOB].filefile
filelistReturns the content of a TEXT, CSV, JSON or FITS file. The "source" could either be a BLOB or a list of filename and BLOB. RGB-data should have the dimensions in the last row, otherwise use CSV.this filereadySciS_readFileAsBLOB(source)12Saves the data to a file of the specified type.SciSnap!DataSciSnap!Data
costumeData
other RGB dataTEXTTEXT
CSV
RGB
JSONthis fileTEXTCSVRGBJSONImports text, table-CSV-data, costume-data, JSON-data, or FITS-data from current costume, a file or an URL to SciSnap!Data.CSV-dataTEXT-data
CSV-data
RGB-data
JSON-data
FITS-data
TEXT-BLOB
CSV-BLOB
JSON-BLOB
FITS-BLOBfilepickercurrent-costume=costume
filepicker
URLisBLOB?1BLOBchoice11filepickercostumecostumeRGBCSVcostumetypeOfDataSciSnap!DatadatavaluewidthheightminValue1maxValuecolumns4rowsRGBTEXTJSONRGBCSV0RGB143dimensionstypeOfDataheightSciSnap!Data100001columnswidthrowsheightFITStruerowscolumns1times1011Adds a new entry to SciSnap!Messages, shows the error message, and stopps all.something wrong!thisBlockCreates a new empty costume of the specified size and color and sets local properties. thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsetrue15lightGraytypeOfConfigurationmyPropertiesGraphPadtypeOfDatanonemyPropertiesxLeft1myPropertiesxRightmyPropertiesyUpper1myPropertiesyLowermyPropertiesverticesMinRadius3myPropertiesverticesGrowingtruemyPropertiesverticesContentShownfalsemyPropertiesedgesDirectedfalsemyPropertiesedgesWithWeightstruemyPropertiesedgesShowWeightsfalsemyPropertiesinitialCostumenullmyPropertiesStagetruelineColortheStageblackRGB-valuedraw1offsetstheStage2offsetstheStage1offsetstheStage2offsetstheStagetheStagefalsetruelineColorblackRGB-valuedraw00falseinitialCostumeCostume attributes and line attributes same as SketchPad.
other attributes:
initial costume, maybe a map
vertex ranges for random coordinates
xLeft
xRight
yUpper
yLower
vertex properties:
minimal radius of a vertex (should be changed if vertices
are not growing with number of edges) = verticesMinRadius
vertices grow with number of connected edges = verticesGrowing
vertex content is shown (If there is no content the vertex number is shown) = verticesContentShown
edge properties:
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeightsthisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
initial costume=initialCostume
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
ranges for vertices={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
vertex properties={
minimal radius=verticesMinRadius
vertices can grow=verticesGrowing
vertices show content=verticesContentShown
}
edge properties={
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeights
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
initial costume=initialCostume
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
ranges for vertices={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
vertex properties={
minimal radius=verticesMinRadius
vertices can grow=verticesGrowing
vertices show content=verticesContentShown
}
edge properties={
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeights
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes.
1: width
2: height
3: back color 400300thisSpritethisSprite
theStage
anotherSpriteStagebackColorxLeft0.1xRight0.9yLower0.9yUpper0.1a simple way to set some vertex attributes:
1: ranges for random coordinates
(xLeft,xRight, yUpper,yLower)
2: minimal radius of a vertex, should be
changed is vertices are not growing
with number of edges
3: boolean: vertices grow with number
of connected edges
4: boolean: vertex content is shown.
If there is no content, the vertex
number is shown3truefalsethisSpritethisSprite
theStage
anotherSpriteverticesMinRadiusverticesGrowingverticesContentShowna simple way to set some edge attributes:
1: line width
2: line color
3: boolean: edge is directed
4: boolean: edge has a weight
5: boolean: edge shows
weight1falsefalsefalsethisSpritethisSprite
theStage
anotherSpritelineWidthlineColoredgesDirectededgesWithWeightsedgesShowWeightsadds a vertex at position. Snap!coordinates means: zero is in the middle of the graphthisSpritethisSprite
theStage
anotherSpritetrueoffsetsoffsetsposition1xLeft2yUpper1xRight2yLower4vertexListadds n vertices to the vertexList of a GraphPad:
Vertex attributes have the following order:
1: x
2: y
3: size
4: content
5: isMarked
6: colorNr
7: numberOfLinks
parameter 'null' means 'random vertices'1thisSpritethisSprite
theStage
anotherSpritedummySciS_addVerticesToGraph(n,amatrix,vlist,properties,point)adjacencyMatrixvertexListmyPropertiesnullMoves a vertex to another position measured in Snap! sprite-coordinates1thisSpritethisSprite
theStage
anotherSprite100truevertexList1vertexList12vertexList2Creates a new edge between two vertices.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListadjacencyMatrixXadjacencyMatrixXedgesDirectedCreates n new edges randomly.1thisSpritethisSprite
theStage
anotherSpriteresultSciS_addRandomEdgesToGraph(amatrix,n,properties,vlist)adjacencyMatrixmyPropertiesvertexListadjacencyMatrix1vertexList2draws the graph on a GraphPad.thisSpritethisSprite
theStage
anotherSpriteinitialCostumeinitialCostumeinitialCostumeinitialCostumeSciS_drawGraphOnGraphPad(amatrix,vlist,properties)adjacencyMatrixvertexListmyPropertiesinitialCostumeDeletes a vertex.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes an edge.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListadjacencyMatrix0edgesDirected12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListSets the weight of an edge.121thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListthisSpritethisSprite
theStage
anotherSpritefrom vertex nrInput for start vertex.thisSpritethisSprite
theStage
anotherSpritenew start vertexwidth (1....20)1thisSpritethisSprite
theStage
anotherSprite0vertexListSets the content of a vertex.1thisSpritethisSprite
theStage
anotherSprite0vertexListInput for a new vertex content.thisSpritethisSprite
theStage
anotherSpritevertex numberTells a vertex to be marked.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes a marker.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes all markers.thisSpritethisSprite
theStage
anotherSpriteitemvertexListDepth first search in a graph.1thisSpritethisSprite
theStage
anotherSprite0vertexListBreadth first search in a graph.1thisSpritethisSprite
theStage
anotherSprite0vertexListReports the Euclidean distance of two vertices.thisSpritethisSprite
theStage
anotherSprite120vertexList0vertexListShortes path between two vertices, using Dijkstra-method.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListShortes paths between startVertex and all connected vertices, using Dijkstra-method.1thisSpritethisSprite
theStage
anotherSprite0vertexListReturns the vertexnumber of a vertex near (x|y), if there is one.thisSpritethisSprite
theStage
anotherSpritetruepositionoffsetsoffsetsSciS_vertexnumberAtGraph(vlist,properties,position)vertexListmyPropertiesReports the vertexnumber of the vertex with the specified content. If not found then reports 0.PeterthisSpritethisSprite
theStage
anotherSpritenr0itemvertexList0meanmeancolumn2thisSpritetrue12numberXdiagramSpriteduplicateDiagramSpriteDiagramSprite400300lightGrayfalsetrue15DiagramSpriteEdges per Node18Number of Edges16Number of Vertices166DiagramSpritetrueDiagramSpriteCreates a new empty costume of the specified size and color ans sets local properties for a NeuralNet.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15costume properties:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for NN position on stage
7: upper offset for NN position on stage
neural net properties:
1: number of layers
2: layer width
3: width of NN
4: height of NNthisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.numberOfLayerstypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
net properties={
number of layers=numberOfLayers
layer width=layerWidth
net width=netWidth
net height=netHeight
input list=inputs
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.numberOfLayerstypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
net properties={
number of layers=numberOfLayers
layer width=layerWidth
net width=netWidth
net height=netHeight
input list=inputs
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: offsets for NN position on stage400300thisSpritethisSprite
theStage
anotherSpriteStagenetWidthnetHeightoffsets00backColora simple way to set net attributes:
1: number of layers
2: layer width23thisSpritethisSprite
theStage
anotherSpritenumberOfLayerslayerWidthCreates a fully connected neural network of perceptrons. Inputs should be connected to layer 1, outputs to last layer.23thisSpritethisSprite
theStage
anotherSpritemyDataone matrix for each layer1myDatanumberOfLayerslayerWidthReports the output of the nth layer of a neural network with given input.last1
lastthisSpritethisSprite
theStage
anotherSpriteinputinputs0vectorlayerWidthDraws the nodes and current status of connections of an NN as new costume.thisSpritethisSprite
theStage
anotherSpriteinputinputs0layerWidthSciS_NNshowStatus(properties,weights,outputs,costume,isStage)myPropertiesmyDataStageA block for teaching a neural net.0.1thisSpritethisSprite
theStage
anotherSpritewidthlayerWidththisSpritethisSprite
theStage
anotherSpriteCreates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15redgreenbluegrayorangecyanmagentayellowwhitetruemyData1010myDataCostume attributes and line attributes same as SketchPad.
other attributes:
numberOfGridColumns
numberOfGridRows
cellWidth
cellHeight
cellColors
1: black
2: red
3: green
4: blue
5: gray
6: orange
7: cyan
8: magenta
9: yellow
10: lightGray
11: white
Reports whether the sprite is configured as a GridPad.thisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
grid proterties={
number of grid columns=numberOfGridColumns
number of grid rows=numberOfGridRows
cell width=cellWidth
cell height=cellHeight
cell colors=cellColors
with grid lines=withGridLines
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
grid properties={
number of grid columns=numberOfGridColumns
number of grid rows=numberOfGridRows
cell width=cellWidth
cell height=cellHeight
cell colors=cellColors
with grid lines=withGridLines
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for Image
position on stage
7: upper offset for Image
position on stage40030000thisSpritethisSprite
theStage
anotherSpriteStagea simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color
4: fill colorcontinuouscontinuous
dashed
dash-dot
dot-dot1thisSpritethisSprite
theStage
anotherSpritelineWidthlineStylelineColorfillColora simple way to set some grid attributes:
1: number of horizontal cells
2: number of vertical cells
3: cell width
4: cell height
grid data are stored in myDatathisSpritethisSprite
theStage
anotherSprite403011truewhcostumeWidthwscostumeHeight11numberOfGridRowsnumberOfGridColumnscellWidthcellHeightcellHeightwithGridLinesmyDatamyDataDraws a grid on an GridPad.myDatathisSpritethisSprite
theStage
anotherSpritemyDatamatrixnumberOfGridColumnsthisSprite1numberOfGridRowsthisSpriteSciS_addGridToGridPad(costume,properties,withLines,data)myPropertieswithGridLinesFills a grid or a part of a grid with one of the specified values.thisSpritethisSprite
theStage
anotherSprite1xMax1yMaxxMaxyMaxmyDataSciS_fillOnGridPadGridRandomlyOnImagePad(xMin,xMax,yMin,yMax,numbers,data)myDatamyDatasets the value of a grid cellthisSpritethisSprite
theStage
anotherSprite1targetCostumetargetCostumeWidthtargetCostumeHeightStage11myDataObtaining data with the mouse from a grid stored in myData.cellValuecell value=cellValue
cell coodinates=cellCoordinates
costume coordinates=costumeCoordinatesthisSpritethisSprite
theStage
anotherSpriteselection1targetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.cellCoordinatescoordinates of a grid cellcellValuevalue of a grid cellSets the value of a grid cell an shows the result.thisSpritethisSprite
theStage
anotherSprite112true11numberOfGridColumnsnumberOfGridRowsthisSpritethisSprite
theStage
anotherSprite1111numberOfGridColumnsnumberOfGridRowsReports the Moore- or v.-Neumann-neighborhood of a cell.
Order: north,east,south,westMooreMoore
vonNeumannfalse11thisSpritethisSprite
theStage
anotherSpriteSciS_neighborhoodInGridOnImagePad(data,properties,x,y,isTorus,typeOfNeighborhood)myDatamyPropertiesSwaps the cell values of a grid randomly.thisSpritethisSprite
theStage
anotherSpritetrue111xMax1yMaxxMaxyMax1numberOfGridColumns1numberOfGridRowsSciS_swapCellsOfGridOnGridPad(data,n,isTorus,range,xMin,xMax,yMin,yMax)myDataCounts the surrounding values and changes it if necessary.thisSpritethisSprite
theStage
anotherSpritetrueanyany22greater-thangreater-than
equal-to
smaller-than
different-from41false51xMax1yMaxxMaxyMaxSciS_changeSurroundingValuesOfGridOnGridPad(data,ifValue,elseValue,surrValue,op,n,isTorus,withNoise,noise,xMin,xMax,yMin,yMax,oldValue)myData11Replaces the cell values of a grid depending on the features of the neighbors.thisSpritethisSprite
theStage
anotherSpritetruesumsum
min
max
mean1xMax1yMax1xMaxyMaxSciS_replaceValuesOfGridOnImagePad(data,operation,isTorus,xMin,xMax,yMin,yMax,range)myData1Combines two grids.1orand
or
xor
not-and
not-or
not-xor
minus212xMax1111yMaxSciS_combineGridsOnGridPad(grid1,grid2,value1,operator,value2,ifValue,elseValue,xMax,yMax)Sets the size of a sprite so that it fits into the specified stage area.thisSpritethisSprite
anotherSprite-200200200-200spriteWidthspriteHeightwindowWidthwindowHeightStage100100thisSpritethisSprite
theStage
anotherSpriteJavaScriptJavaScript
Snap!positionJavaScript12thisSpritethisSprite
theStage
anotherSpritereceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessageangle: LineEnd12receiveInteraction mouse-departedisMovingTheLineToolmyWindowTheLineToolLineEnd1receiveInteraction mouse-departedisMovingLineEnd1myWindowTheLineToolLineEnd2receiveInteraction mouse-departedisMovingLineEnd2myWindowTheLineToolTheSquareToolreceiveInteraction scrolleddownTheSquareToolreceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessage
getDatasize/55isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valueSciS_changeToolCostume(size,tool,color)squareToolorangeRGB-value16getDatareceiveInteraction mouse-departedreceiveKey +isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valuereceiveKey -isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valuereceiveKey left arrowisActivereceiveKey right arrowisActivereceiveKey up arrowisActivereceiveKey down arrowisActive20theWindow3320theWindowremoveline15createline15TheLineTool20theWindownewSpritethisSpriteTheWindow-200150Activate SquareTools by mouseclick, enlarge or reduce activated SquareTools by +/- keys, move them by arrow keys. Get data by shift-click on a SquareTool.createa squareTheWindow501mySquareToolscreatea squareTheWindow50createa squareTheWindow50Random graphic, inspired by "Merzbild 1a - the psychiatrist"
painted by Kurt Schwitters.20502050lightGrayStageHilbertoLeft350-250The reaction of the sprite must be defined in the block "let <sprite> respond to <event>".5Hilbertochoose costumereceiveKey +add three event handlerreceiveKey -receiveInteraction clickedLet me grow/shrink by pressing the +/- buttons or delete me by mouse click.choose costumeConverts a variadic position parameter into a position.Converts a variadic color parameter into a RGB(A)-value.41truetrueCurrently not used.any textApplies a Wolfram Cellular Automaton to a grid.3031SciS_applyWolframAutomatonToAgridOnGridPad(no,grid,color0,color1)Reports whether the set is numerical or not.this set2Installs an event handling method for a sprite.receiveGoreceiveGo
receiveKey enter
receiveKeyspace
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessagethisSpritethisSprite
theStage
anotherSpritecallerxml<script app="Snap! 9.0, https://snap.berkeley.edu" version="2"><script><block s="Go0Key0receiveMessage0receiveInteraction0xml</block><custom-block s="let %s respond to %s"><block s="reportObject"><l><option>myself</option></l></block><l></l></custom-block></script></script>Extracts the words in upper case from a text, e.g. for statistical analysis or cryptographic purposes. AZReports a list [p(category1), p(category2), LagrangeSmoothing1, LagrangeSmoothing2, probabilities1, probabilities2) for naive Bayes classification of texts.pCat1pCat2text11i2text21i2text1text2countedWords110countedWords210vocabulary1column1truevocabulary2column1truetotal vocabularylengthTotalVocabularylengthVocabulary1lengthVocabulary2conditional probabilities1valueconditional probabilities2value11this textresult1factor6result212resultikey,valuetypeOfData,not setwidth,not setheight,not setminValue,not setmaxValue,not setcolumns,0rows,0maxSetValue,500key,valuelineStyle,continuouslineColor0,0,0fillColor180,180,180textHeight,12textOrientationtruewithCloseButtonfalsecloseButtonLeftfalsecloseButtonSize,15backColor230,230,230frontColor0,0,0costumeWidth,400costumeHeight,300width,400height,300offsets0,0typeOfConfiguration,MathPadlineWidth,1onlyPointsfalsedimensions,2xMin,-10xMax,10yMin,-10yMax,10zMin,-10zMax,10startPoint0,0withGrid?,0typeOfData,complex-numbernot set
\ No newline at end of file
+Creates a new sprite, a duplicate, or a permanent clone.duplicatepermanent Clone =permanentClone
duplicate
new sprite=newSpritethisSpritethisSprite
anotherSpritespriteNamewhat1existingSpritesSciS_createObject(operation,sprite,spriteName)itemsomething wrong!create new sprite of spriteImports a stored sprite from a file selected with filepicker.Returns "true" if JavaScript is enabled, else "false".errorReturns "true" if the key no. n is pressed, else "false".27Reports date and time in standard notation.day10hour10minute10second10--T::Reports the selected part of the datetime.seconds todayJulian Date
decimal years
days this year
hours this year
minutes this year
seconds this year
hours today
minutes today
seconds todayYYYY17MM54DD21h12m45s7daysi11402Julian Date2JD365.2530.6001172099531121531101215821260360024Input dialog for a list of items. Click item by mouse and then ok. Returns the selected item.thisSpritethisSprite
anotherSpritetitleresult0costumeheight2570widthi1width8 (click on it)costumelightGrayfalsefalse15continuous1blacklightGray (click on it)102018truefalsei1draw2530505false281218truefalsedraw70301005falseok751218truefalseokfalse70100305oktrue0Allows reading global settings programmatically.
Copied from Snap! library.pt:o valor da configuração _
ca:paràmetre _
Stage sizeProject notes
Project name
User
Presentation mode
Language
Zoom blocks
Stage size
Stage scale
Retina display support
Long form input dialog
Plain prototype labels
Input sliders
Execute on slider change
Clicking sound
Turbo mode
Flat design
Keyboard editing
Visible stepping
Thread safe scripts
Prefer smooth animations
Flat line ends
Codification support
Inheritance support
Hyper blocks support
Visible paletteAllows changing global settings programmatically.
This block is for Boolean (checkbox) settings; use
SET VALUE for numeric or text values.
Copied from Snap! library.pt:altera o valor da configuração _ para _
ca:fixa el paràmetre _ a _
Turbo modePresentation mode
Retina display support
Long form input dialog
Plain prototype labels
Input sliders
Execute on slider change
Clicking sound
Turbo mode
Flat design
Keyboard editing
Visible stepping
Thread safe scripts
Prefer smooth animations
Flat line ends
Codification support
Inheritance support
Hyper blocks support
draggabletrueReports the row or column number of the row or column with the name entered, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).columncolumn
rownameSciSnap!Datatable010columnfirstlast1#n0i10i100rowfirstlast1#n0i10i10ERROR: something wrong!row/column ... of ... --> numberReports the row or column name of the row or column with the number entered, or reports an error message.columncolumn
row1SciSnap!Datatable0columnrowEvaluates the predicate with a given parameter.ringified predicateEvaluates the intervals with a given parameter.ringified predicateinterval3<falsefalseimplies -->implies -->
is equivalent to <-->trueis equivalent to <-->ERROR: something went wrong!Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]2resultn11141413<2≤3≤2<3<2<4414142<3≤2≤3<2<3<true323111111111121212121212121211resultn1m1n111resultn1Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]11define left edge and operator44define right edge and operator0listOfIntervalsitemfalseReturns all elements of a list not covered by the predicate.Returns a set only with elements in item 3 not covered by the intervals or the predicate.result3343lst_sort(list, fn)355i132305Returns all elements of a list not covered by the intervals.Test wether the predicate is translatable to a list of intervals.ringified predicate1comparisonOperator1123value32value2falseIntervals should be of structure [leftLimit,operator1,operator2,rightLimit]interval1interval2intersection0result1144341444341444determines intervals1 \ intervals2resultm1n1m1resultintervalresultinterval01predicate12i32<3<intervalsi1Shows the message with headline in the middle of the window.headlinetheMessageReports a vector, built by the items.Returns a new vector of dimension n with random elements.3110Returns a matrix formed from the input vectors.length1transposed?1column-vectorresultvectorReturns a new nxm-matrix with random elements.32110i1Creates the transpose of a vector, matrix, or table.vector or matrix0Determines a property of a matrix or vector.minmin
max
minpos
maxpos
number
sum
mean
median
variance
standard-deviation
softmaxmatrix or vectorchoice1vectordatasoftmaxmedianminmaxnumbersummeanminposposY1maxposposY1variancestandard-deviationstandard-deviationERROR: unknown option!... of matrix or vectorLinear operations with scalars, vectors and matrices.*+
-
*
X-*ERROR: illegal operation between numbers!linear operationvectormatrixERROR: illegal operation with a number!linear operationvectorisAtransposed?column-vectorvectortrue-true*X33trueERROR: illegal vector operation!linear operationmatrix*ERROR: illegal operation!linear operationvector matrix operationERROR: illegal operation!linear operationmatrixvectorERROR: illegal operation!linear operationERROR: the vector should be a column vector!linear operationmatrix vector operationmatrixmatrix matrix operation-*rowERROR: illegal operationlinear operationApplies a mapping matrix to an object that is given as a matrix of points.matrixlist of pointsSolves a linear system of max. 50 equations.matrixcolumn vectorcolumn-vector01bmatrixcreate matrix with attached column bsolvedtrue50columncreate matrix with attached column bdTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonalizer1Reports a list of matrix A in triangle form, the rank of A, column change and column positions.matrix0Aba copy of A is used to let A unchangedrankrow1columchangefalsecolumn positions11i1search downwardsi1search to the rightc0row1row1row-1transform to diagonal form ECalculates the coefficients of the interpolation polynomial for a 2xn-matrix of points.list of points212matrixcreate matrix of powers of x and y-valuesolvedtruen50datai1j-12dTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonaizer1Calculates the value of a polynomial for input x.polynomial as list of coefficients11result12i3Applies an affine transformation to a list of points.
list of points3 original points3 target pointsoktrueP11P22P33Q11Q22Q33S1221221220ERROR: denominator is zeroaffine transformation of ...Reports a complex number in Cartesian form.23Reports a complex number in polar form.230Reports a complex number in polar or Cartesian form.complex numberpolarpolar
CartesianReports properties of complex numbers.real-partabsolute-value
real-part
imaginary-part
phase
conjugatecomplex numberreal-partimaginary-partphaseconjugateERROR: unknown operator!... of complex numberReports arithmetic results of two complex numbers.z1++
-
*
/z2complex-numbercomplex-number-polar-formcomplex-number-polar-form+-*/cnC22333223Creates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15SciS_MathpadAddAxes(costume,properties)myPropertiescostume attributes and line attributes same as SketchPad:
other attributes:
- draw only ponts, not arrows
- dimension of coordinate system
- max. value on scales
- start point of arrowsReports an empty dictionary.This block creates new variables on the selected scope: global (for all sprites), sprite (for this sprite only) or script (only for that blocks stack) with the names given (in 'names' list).
If there is already a variable with that name in that scope, it does nothing: no errors and no overwrites.pt:cria as variáveis _ _
ca:crea les _ variables _
es:crear las _ variables _
de:erstellen _ var _
globalglobal
sprite
scriptReports an RGB-value specified by name, number, tree or four values, or list. Default value is gray.grayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentaRGB-valueRGB-value
RGBA-value4truetruetrueReturns an empty costume of the given width and height with background color given as text or list.400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentaReports true if the varname is part of the scope of the sprite. the varname is not used case-sensitive!varnamethisSpritethisSprite
theStage
anotherSpritevar_names(scope)spriteSets the value of an existing property or inserts it anew.dimensionstypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
MathPad properties={
type of data=typeOfData
draw only points, not arrows=onlyPoints
dimensions
max value on scales=maxValue
min value on scales=minValue
start point for arrows=startPoint
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReturns the value of a property.dimensionstypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
MathPad properties={
type of data=typeOfData
draw only points, not arrows=onlyPoints
dimensions
max value on scales=maxValue
min value on scales=minValue
start point for arrows=startPoint
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for MathPad
position on stage
7: upper offset for MathPad
position on stage
8: close-button properties40030000truefalse15thisSpritethisSprite
theStage
anotherSpriteoffsetsmyPropertiesa simple way to set some MathPad attributes:
1: line width
2: draw only ponts, not arrows
3: dimension of coordinate system
4: max. value on scales
5: start point of arrows1false3-1010-1010-1010000thisSpritethisSprite
theStage
anotherSpriteoldDimensionsdimensionsmyPropertiesoldXmaxxMaxmyPropertiesoldXminxMinmyPropertiesoldYmaxyMaxmyPropertiesoldYminyMinmyPropertiesoldZminzMinmyPropertiesoldZmaxzMaxmyPropertiesoldWithGrid?withGrid?myPropertieslineWidthmyPropertiesonlyPointsmyPropertiesdimensionsmyPropertiesxMinmyPropertiesxMaxmyPropertiesyMinmyPropertiesyMaxmyPropertieszMinmyPropertieszMaxmyProperties321withGrid?myPropertiescostumeWidthcostumeHeightbackColorDraws a vector, complex number, or object of points from the start point stored in the properties.vectorvector
complex-number
line-to
object-ofblackblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentathisSpritethisSprite
theStage
anotherSpritefalsetypeOfDataobject-ofdimensionsmyProperties1SciS_MathPadPlot(costume,data,color,properties,choice)RGB-valuemyPropertiescomplex-numberdimensionsmyProperties21cnPdata23SciS_MathPadPlot(costume,data,color,properties,choice)RGB-valuemyPropertiesSciS_MathpadAddAxes(costume,properties)myPropertiesvectorline-todimensionsmyPropertiescolumn-vectorSciS_MathPadPlot(costume,data,color,properties,choice)RGB-valuemyPropertiesobject-ofDraws members of a set.set1blackblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magenta11thisSpritethisSprite
theStage
anotherSpritesetdimensionsmyProperties115propertiesmyPropertieswidthwidthheightheightxminxMinxmaxxMaxleftOffset1offsetsupperOffset2offsetsdl305level30x0lineColorlineWidthSciS_MathPadPlotSet(set,setname,properties,atY,costume)myProperties20Changes the name of a costume.a costumenew costume nametrueAdds or replaces an entry in a dictionary.Allows changing global settings programmatically.
This block is for numeric or text settings; use
SET FLAG for Boolean (checkbox) values.
Copied from Snap! library.pt:altera o valor da configuração _ para _
ca:fixa el valor de _ a _
Stage sizeProject notes
Project name
Language
Zoom blocks
Stage size
Stage scale
Visible paletteSets a local variable of a sprite to the specified value.varnamethisSpritethisSprite
theStage
anotherSpriteanyValueReports the value of a local variable.varnamethisSpritethisSprite
theStage
anotherSpriteERROR: variable don't exist.get ... of spriteThis block deletes all the variables with the names given (inside input list).
Each name will make only one variable deletion, and this will be the variable found following the scope order: 'script' -> 'sprite' -> 'global'.
If we have a "testing" sprite variable and also a "testing" global one, deleting "testing" will delete only the sprite one (Yes! we can also do "delete var (testing, testing)" to delete both.
If one variable does not exists (in any scope) an error happens, stopping block action in that point. You can check it before with the "does var (name) exists?"block. pt:remove as variáveis _
ca:esborra les variables _
es:borrar variables _
de:löschen var _
Reports the value assigned to the key.Replaces the value assigned to the key with a new value.Removes the entry of a key.Reports the content of a selected file.Stores a dictionary as a JSON file.filenamefilename
filepickerJSONReports a copy of a costume.a costumeReports the costume of a sprite or the stage.thisSpritethisSprite
theStage
anotherSpritecostumeDisplays a list in a dialog window.This command closes all open dialog windows in a brutal way. ;-)errorCatch errors.
Runs the first script. If it succeeds, nothing else happens.
But if it has an error (something that would otherwise result
in a red halo around the block), then the second script is run,
with the text of the error message that would have been shown in the variable ERROR.pt:tenta executar _ e, em caso de erro _ , executa _
ca:prova de forma segura _ i si _ _
Reports the current layer of a sprite.Sets the layer of a sprite.0Selects the specified costume for the cursor.pointerauto
cell
copy
crosshair
default
grab
grabbing
help
move
not-allowed
pointer
progress
text
wait
zoom-in
zoom-out
n-resize
s-resize
e-resize
w-resize
ne-resize
se-resize
nw-resize
sw-resizeTest on vector, matrix, table, predicate, interval, list of intervals, set, dictionary or complex-number.vectorvector
row-vector
column-vector
matrix
table
dictionary
complex-number
complex-number-Cartesian-form
complex-number-polar-form
set
comparisonOperator
interval
listOfIntervals
numericalListvectorcolumn-vectorrow-vectorcolumn-vectormatrix1SciS_isType(data,selection)matrixtable1SciS_isType(data,selection)tabledictionary01keyvaluetable12intervalfalsecomplex-numbercomplex-number-Cartesian-formcomplex-number-polar-formlistOfIntervalstrueset234listOfIntervals55numericalListresult0falsefalseReturns a random number between 0 and 1.Reports Pi.Reports Euler's number.The factorial function.Reports a binomial coefficient.531result1n1i1Rounds value x to n digits.1.23572Reports a string with replacement instead of substring.allall
firstthisthatthisStringReports the index of first appearance of substring in string.ringthisStringReturns a root of an equation calculated with Newton's method.ringified term1epsilon0.00001i11000Reports an element of a sequence.ringified term1Returns a list of the first n elements of a sequence.1ringified term1Returns a list of secant slopes calculated with the given sequence.ringified term21/n1/nelementReports the secant slope "nearby" the given point.ringified term1epsilon0.00001Returns a finite sum.10ringified term0result0iReturns the integral of a term calculated with n trapezoids.2ringified term11000dxx11Reports either
- data Fourier transformed to frequency-space
- "raw" FFT (Fast Forier Transformation) data formatted as SciSnap! complex numbers
- or iFFT real datafrequency_spectrumfrequency_spectrum
complex_FFTdata
iFFT_of_FFTdata100iFFT_of_FFTdataSciS_FFTops(data,freq,choice)Reports coefficient of the binomial distribution b(N,p,k)=(N choose k)*p^k(1-p)^(N-k)100.12ERROR: wrong parameter!b(...)Reports binomial distribution B(N,p,k).1100.1ERROR: wrong parameter!B(...)Reports coefficient of the hypergeometric distribution.10352ERROR: wrong parameter!h(...)Reports hypergeometric distribution.11035ERROR: wrong parameter!H(...)Reports coefficient of the Poisson distribution.0.052ERROR: wrong parameter!p(...)Reports Poisson distribution.20.05ERROR: wrong parameter!P(...)Reports coefficient of the Pareto distribution.132Reports coefficient of the normal distribution.101The empty set.The real (computer-) numbers.Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.230Creation of a set by one numerical interval.
Predicates and elements should be defined by other blocks.
Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.-Infinity-Infinity≤≤
<≤≤
<InfinityInfinitysettrueCreation of a set by a predicate.
Intervals and elements should be defined by other blocks. If possible the predicate is translated to a list of intervals.
Returns a set by listing the elements, predicates, and defined intervals. The three sections are treated as a disjunction: Elements belong to the set if they are enumerated, lie within intervals, or satisfy the predicate. If possible, they are defined by intervals.
The sequence is: <set><isNumerical><list of elements><list of intervals><predicate>.ringified predicatepredicateTreeReports whether "element" is element of "set".elementsetsetReports the intersection, union, difference, or cross product of two sets.set1∩∩
∪
\
Xset2are these two sets?set∪∩4044455555\444interval list of set1 and nor covered from interval list of set25If set2 has a predicate, we have to transform the interval list of set1 into a predicate.Xset2233Is set1 subset of set2?set1set2are these two sets?set555intervalelement3Compare elementstrueAre theses two sets equal?set1set2setReports up to n elements of a set. Numers are natural numbers smaller than maxSetValue in SciSnap!-properties.10setresult3405i1maxSetValue should be close to infinity ;-)resultvalueindexlistclean up1Reports the enumerated elements and numbers written as intervals of the set.elementselements
intervals
predicatethis setelementsintervalspredicatetrueReturns the value of the left or right edge of an interval.leftleft
rightReports simple types, sets and lists as string.5i1maxSetValue should be close to infinity ;-)elementsvalueindexlist20item18is first elementtrueitem18ERROR: no simple type!elements --> textConverts a string to a list of elements.1,2,[3,4],{6,7,8..12}]10]0]0}10}0}0find listsReturns an empty table.Reports the copy of a list or an empty list.table or listType conversionstable or listCSVDATAASTEXT
CSV
JSONReports a new table initialized with value.23a valueresultReports a table with labeled columns.23i1rowERROR: labels required!new ... table with labelsReports randomly distributed points in the form of a rectangle, circle, or ring.100-100100-100100squaresquare
circle
ringcircleringCreates new random data in the specified ranges swaying by a straight.10-55102Generates a list of points "near" a given graph.20-552Reports the row or column of a table identified by number or name, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).rowrow
columnnumberOrNamefirst
last
numberOrNameSciSnap!Datatruechoice1tablerowlast1columnlast11ERROR: something wrong!row/column of dataAdds a row, a column, or column headers to a table.rowrow
column
column-headersa listSciSnap!Datachoice1tablerowi1column0i1column-headersi11Deletes a row or column of a table. identified by number or name, or reports an error message. If the the name is a number You can mark this with a # (e.g. #123).rowrow
columnnumberOrNamefirst
last
numberOrNameSciSnap!Datatablerowlastcolumnlast11itemReports the element a position x|y of a table, identified by numbers or names.numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001Replaces the value at position x|y of a table.numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001Reports the columns from row startnr to row endnr.SciSnap!DatanumberOrNamelastlast
numberOrNametablelaststartnrrowendnrrowcolNumbersitemSciS_columncopy(data,cols,start,stop)Reports a subsection of an image or table.RGB-datatable-data
matrix-data
list-data
RGB-data
FITS-dataSciSnap!DatanumberOrNamenumberOrNamenumberOrNamenumberOrNamelist-dataresultdummyvalueindextable-datamatrix-datab1columnb2rowe1columne2rowbeginendSciS_subsection(data,begin,end)RGB-dataFITS-dataRGB-datawidthwidthheightheightFITS-datawidthwidthheightheightbeginendSciS_subsectionImage(data,begin,end,width,height)Determines the rows of a table with certain properties.SciSnap!DatanumberOrNameless-thanless-than
greater-than
equal-to
different-fromtablencolumn11op1less-thangreater-thanequal-todifferent-fromcounts the appearances of the values of a list or table.a table or listReports a sorted list.a listreturns the entropy of a list of dataa table or listReports a new list whose items are the same as in the input list, except that if two or more equal items appear in the input list, only the last one is kept in the result.SciSnap!DatatableNormalizes a table by dividing it by the specified value.SciSnap!Datameanmean
max
number
sum
median
softmaxchoice1vector0Reports a vector or matrix with compressed columnsonly columns .SciSnap!Data2isMatrixmatrixvector11resulti11iresultcolumnNr11Pooling operation with matrices, images and vectors. On the top of the result are the new dimensions.maxmax
meanSciSnap!Data21typeOfPooling1matrixvectorFITSRGBmatrixFITSRGBSciS_pooling(data,width,height,typeOfPooling,stride,typeOfData)Sorts a list or table.SciSnap!DatanumberOrNametruetrueisTabletable1result1Determines a group of properties of a table.meanmin
max
number
sum
meannumberOrNameSciSnap!DatanumberOrNametruetablegroupcolumncolumn11valuecolumncolumn11choice1copytrue0SciS_groupeddata(aTable,compaircolumn,operation,groupcolumn)Calculates the ranges, the covariance or the correlation between two columns of a table.
rangesranges
covariance
correlationnumberOrNamenumberOrNameSciSnap!Datatruetablencolumn11mcolumn11copychoice11SciS_propertiesoftable(selection,table,x,y)1Calculates the parameters of a regression line.SciSnap!DatamatrixsumX0sumY0numerator0denominator0dummymeanXmeanYdummymbDetermines the next k neighbours of a point in data. The classes of the points have to be in column 3. Reports a list with columns x, y, distance, class.52-dim pointSciSnap!Datatablepoint2neighbors3truetruetable-data114Applies a convolution to a table with FITS, RGB, or table values.a kerneltableimage
tableSciSnap!Data100100matrixSciS_convolution(kernel,data,width,height,typeOfData,mIndex,kWidth)Custering of n-dimensional data with k-means-method. Cluster numbers are attached to the data.3SciSnap!DatamatrixSciS_k-means-clustering(k,data)Custering of n-dimensional data with k-means-method. A metric has to be delivered as a ringified term. Cluster numbers are attached to the data.3SciSnap!Dataringified operatormatrixresultadd cluster number 0 to datadimension1minmaxi1calculate min and max for all columnscentersi1choose k random centerscalculate min and max for all columnsanyChangestruen0anyChangesfalsedummycenter1pointbuild clustersadjust centerslabels of data: -1 not visited, 0 visited, -2 noise, >0 clusternrSciSnap!Data505matrix2SciS_DBSCAN(data,r,minMembers)-1reports an ID3 decision tree constructed on the base of labeled dataSciSnap!Datatablewrong data0empty datasetSciS_ID3Tree(data)returns the class of a dataset using an ID3-decision-treedatathis ID3-treecompareData1leaf1leaf (unambiguous)1nodei1ERROR: no sensefull data to compare found!Creates a new empty costume of the specified size and color and sets the local properties.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
whitered
orange
yellow
green
cyan
blue
magentafalsefalse15scalesXprecision2myPropertiesscalesYprecision2myPropertiesscalesXtextheight12myPropertiesscalesYtextheight12myPropertiesscalesXintervals6myPropertiesscalesYintervalsmyPropertiesscalesXstart-10myPropertiesscalesYstart-10myPropertiesscalesXstep2myPropertiesscalesYstep2myPropertiesscalesXscaling1myPropertiesscalesYscaling1myPropertiesscalesTiclength6myPropertiesscalesXminitics0myPropertiesscalesYminitics0myPropertiesscalesXgridfalsemyPropertiesscalesYgridfalsemyPropertiesscalesXcenteredfalsemyPropertiesscalesYcenteredfalsemyPropertiesscalesShowXscaletruemyPropertiesscalesShowYscaletruemyPropertiesplotBordertruemyPropertiesCostume attributes and line attributes same as SketchPad.
other attributes:
plots
marker properties:
1: marker style
2: marker width
3: marker connected
4: marker color red
5: marker color green
6: marker color blue
data properties:
1: minValue
2: maxValue
3: columns
4: rows
scale offsets:
1:left offset
2: right offset
3: upper offset
4: lower offset
labels:
1: title
2: x label
3: y label
4: title height
5: x label height
6: y label height
7: x unit
8: y unit
ranges:
1: x left
2: x right
3: y lower
4: y upper
scale properties:
1: scales x precision
2: scales y precision
3: scales x textheight
4: scales y textheight
5: scales x intervals
6: scales y intervals
7: scales x start
8: scales y start
9: scales x step
10: scales y step
11: scales x scaling
12: scales y scaling
13: scales ticlength
14: scales x minitics
15: scales y minitics
16: scales x grid
17: scales y grid
18: scales x centered
19: scales y centered
20: scales show x scale
21: scales show y scale
22: plot borderReports whether the sprite is configured as a PlotPad.thisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
plots
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
marker properties={
marker style=markerStyle
marker width=markerWidth
marker connected=markerConnected
marker color=markerColor
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
}
scale offsets={
left offset=scaleLeftOffset
right offset=scaleRightOffset
upper offset=scaleUpperOffset
lower offset=scaleLowerOffset
}
labels={
title=title
x label=xLabel
y label=yLabel
title height=titleHeight
x label height=xLabelHeight
y label height=yLabelHeight
x unit=xUnit
y unit=yUnit
}
ranges={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
scale properties={
scales x precision=scalesXprecision
scales y precision=scalesYprecision
scales x textheight=scalesXtextheight
scales y textheight=scalesYtextheight
scales x intervals=scalesXintervals
scales y intervals=scalesYintervals
scales x start=scalesXstart
scales y start=scalesYstart
scales x step=scalesXstep
scales y step=scalesYstep
scales x scaling=scalesXscaling
scales y scaling=scalesYscaling
scales ticlength=scalesTiclength
scales x minitics=scalesXminitics
scales y minitics=scalesYminitics
scales x grid=scalesXgrid
scales y grid=scalesYgrid
scales x centered=scalesXcentered
scales y centered=scalesYcentered
scales show x scale=scalesShowXscale
scales show y scale=scalesShowYscale
plot border=plotBorder
pretty formated=pretty
y-axis starts with 0=start0
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
plots
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
marker properties={
marker style=markerStyle
marker width=markerWidth
marker connected=markerConnected
marker color=markerColor
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
}
scale offsets={
left offset=scaleLeftOffset
right offset=scaleRightOffset
upper offset=scaleUpperOffset
lower offset=scaleLowerOffset
}
labels={
title=title
x label=xLabel
y label=yLabel
title height=titleHeight
x label height=xLabelHeight
y label height=yLabelHeight
x unit=xUnit
y unit=yUnit
}
ranges={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
scale properties={
scales x precision=scalesXprecision
scales y precision=scalesYprecision
scales x textheight=scalesXtextheight
scales y textheight=scalesYtextheight
scales x intervals=scalesXintervals
scales y intervals=scalesYintervals
scales x start=scalesXstart
scales y start=scalesYstart
scales x step=scalesXstep
scales y step=scalesYstep
scales x scaling=scalesXscaling
scales y scaling=scalesYscaling
scales ticlength=scalesTiclength
scales x minitics=scalesXminitics
scales y minitics=scalesYminitics
scales x grid=scalesXgrid
scales y grid=scalesYgrid
scales x centered=scalesXcentered
scales y centered=scalesYcentered
scales show x scale=scalesShowXscale
scales show y scale=scalesShowYscale
plot border=plotBorder
pretty formated=pretty
y-axis starts with 0=start0
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: front color
5: left offset for plot
position on stage
6: upper offset for plot
position on stage
40030000thisSpritethisSprite
theStage
anotherSpriteStageSets the labels and textheights of the diagrams of a PlotPad and redraws them.thisSpritethisSprite
theStage
anotherSpriteDiagram Title18x-label16y-label16titlexLabelyLabeltitleHeightxLabelHeightyLabelHeighta simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color red
4: line color green
5: lineColor bluecontinuouscontinuous
dashed
dash-dot
dot-dot
rainbow
inverse-rainbow1thisSpritethisSprite
theStage
anotherSpritelineStylelineWidthlineColora simple way to set some net attributes:
marker properties:
1: marker style
2: marker width
3: marker connected
4: marker color red
5: marker color green
6: marker color bluesquarenone
o_circle
._point
+_plus
x_ex
square
triangle5falsethisSpritethisSprite
theStage
anotherSpritemarkerStylemarkerWidthmarkerConnectedmarkerColorSets some properties for scales and redraws them.2212121010thisSpritethisSprite
theStage
anotherSpritefalsescalesXprecisionscalesYprecisionscalesXtextheightscalesYtextheightscalesXintervalsscalesYintervalsscalesXstartxLeftscalesXstepxRightxLeftscalesXintervalsscalesXscaling1scalesXminitics1scalesYstartyLowerscalesYstepyUpperyLowerscalesYintervalsscalesYscaling1scalesYminitics1Sets the distances of the diagram axes to the edges of the Sketchpad.thisSpritethisSprite
theStage
anotherSpriteupperOffset1scalesXtextheighttitle0scalesTiclength0lowerOffset1scalesXtextheightscalesYcenteredrightOffset1.5scalesYtextheightscalesTiclength0leftOffset1scalesYtextheightscalesXcenteredscalesTiclength0scaleLeftOffsetscaleRightOffsetscaleUpperOffsetscaleLowerOffsetSets the ranges for the axes of the diagrams of a PlotPad and redraws it..-1010-1010false0.1thisSpritethisSprite
theStage
anotherSpriteprettyDraws the graph of a function given as rigified Snap!-function or coefficient-list of a polynomial. ringified operator or polynomialthisSpritethisSprite
theStage
anotherSpritevectorSciS_addGraphToPlotpad(costume,properties,aFunction,proc)myPropertiesoldPlotsplotsisNewtrueentryDraws the data points of a two-dimensional table with numerical values. With a lot of additions from Rick Hessman. Thanks!myDatathisSpritethisSprite
theStage
anotherSpritemyDatamatrix12SciS_addNumericDataplotToPlotPad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws the data points of a two-dimensional table with numerical values in column 2.
Text values should be used to set the x-label.myDatatruetruethisSpritethisSprite
theStage
anotherSpritemyDatatableSciS_addMixedDataplotToPlotPad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws a histogram of histogram data.With a lot of additions by Rick Hessman. Thanks!myData10thisSpritethisSprite
theStage
anotherSpritetruemyDatavector0costumestart0transposed-vectorminmaxdeltah2resulti1221i1histgramData0prettySciS_addHistogramToPlotpad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentryDraws and labels the axes of a PlotPad.
With lot of additions of Rick Hessman. Thanks!thisSpritethisSprite
theStage
anotherSpriteClears the plot area of a PlotPad.plotAreaplotArea
plotData
costumethisSpritethisSprite
theStage
anotherSpriteoldFillColorfillColorfillColorbackColorplotAreacostumeplotDatafillColorRestores the last plotson the PlotPad.thisSpritethisSprite
theStage
anotherSpriteplotplots1numericData1mixedData1histogramSets the ranges to "pretty" values. Many thanks to Rick Hessman!thisSpritethisSprite
theStage
anotherSpriteprettyxLeftxRightscalesXintervalsget dictionary of pretty x-values.scalesXstartstartscalesXstepstepscalesXscalingscalingscalesXintervals6scalesXtextheightscalesXprecisionprecisionscalesXminiticsminiticsxLeftstartxRightstopprettyyLoweryUpperscalesYintervalsget dictionary of pretty y-values.scalesYstartstartscalesYstepstepscalesYscalingscalingscalesYintervals8scalesYtextheightscalesYprecisionprecisionscalesYminiticsminiticsyLowerstartyUpperstopcostume"Pretty" scaling from Rick Hessman. Many thanks!-1010620002000Numbers are too big for pretty printing.nintpretty0.0010.0020.0050.010.020.050.10.20.512510205010020050010002000between91341341341341341341places33322211100000000000sign2index1i21dticnintresultdeltanstartstart*scaling is the actual starting value (start is the value displayed next to the tic)stop1stepstep*scaling is the actual stepping value (step is the difference between the tic labels).scalingintervalsprecisionminiticsthisSpritethisSprite
theStage
anotherSpritemyData0.1myData2dy43xLeft1xRight2yLower3yUpper4scalesXstart1scalesXstep21scalesXintervalsscalesXscaling1scalesXminitics1scalesYstart3scalesYstep43scalesYintervalsscalesYscaling1scalesYminitics1Calculates the ranges of two columns of a table.
Conversion of coordinates.100xpxp
yp
x
ythisSpritethisSprite
theStage
anotherSpritediagramWidthscaleLeftOffsetdiagramHeightscaleLowerOffsetscaleUpperOffsetx0xLeftxLeftxRighty0yUpperyUpperyLowercoordinate1xpypxyObtaining coordinates of a PlotPad at mouseposition.costume-coordinatescostume-coordinates
graph-coordinatesthisSpritethisSprite
theStage
anotherSpriteselection1targetCostumetargetCostumeWidthtargetCostumeHeighttargetXPositiontargetYPositiontargetSizecostume-coordinatescostume coordinates.graph-coordinatescostume coordinates.400300continuouso_circle0400300continuous00600400continuousnone
continuous
dashed
dash-dot
dot-dot
rainbow
inverse rainbowsquarenone
o_circle
._point
+_plus
x_ex
square
triangle0thisSprite0.07thisSpritethisSprite18161615thisSpritethisSpriteChanges the spritename.thisSpritethisSprite
anotherSpritenew nameSciS_changeSpritenameTo(sprite,newName)Reports a list of sprites with similar names. Used when "cleaning up".thisNameChecks whether an element is anywhere in a list.this valueCreates SQL variables and sets some properties.Establishes connection and sets the corresponding properties. Change parameters if necessary. connectionhttps://snapextensions.uni-goettingen.de/mysqlquery.php?server=db1&user=snapexuser&password=snap!userconnection&type=connect12ok0115ERRORReports a list of databases on the server and sets the corresponding properties.databasesconnection&type=getDBs000115ERRORSelects one of the databases and sets the corresponding properties.2databasescurrentDatabasedatabasesdummyconnection&command=USE currentDatabasetablestablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERRORReports a list of tables of the chosen database and sets the corresponding properties.tablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERRORSelects one of the tables and sets the corresponding properties.1tables0115ERRORReads the attributes of the specified table and sets the corresponding properties.1tables0115ERRORGenerates a simplified SQL query.*
DISTINCTi11result FROM 0result2Generates an almost complete SQL query.*
DISTINCTASCASC
DESC10i11result FROM 0result20result20resultASCExecutes an SQL query.1:ERRORreplaces "%" with "%25" to prevent trouble with the url-block.resultconnection&type=query&query=&database=currentDatabaseImports the results of an SQL-query to SQLData and sets the corresponding properties.typeOfDatatable0minValuenot setmaxValuenot setReturns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL predicate.Returns an SQL value.Returns an SQL value.Returns an SQL value.Returns an SQL value.Returns an SQL value.Partly copied von Brian Harvey's manual.Inspired by the "drip painting" of Jackson Pollock. ;-)005050-3020redblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magenta100thisSpritethisSprite
anotherSprite
theStagedx100dy100costumecolorRGB-valueSciS_drip(xa,ya,width,height,dx,dy,color,costume,n)Creates a list of the specified length, filled with the specified entry.10anythingInspired by Jackson Pollock ;-)StageStage220200225Creates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15Costume attributes and line attributes same as SketchPad.
other attributes:
data properties:
minValue
maxValue
columns
rows
mean of values
stddev of values
image properties:
image type (RGB,FITS)
imageWidth
imageHeight
imageRealSize
Reports whether the sprite is configured as an ImagePad.thisSpritethisSprite
theStage
anotherSpriteReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
mean value=mean
standard deviation=stddev
}
image properties ={
image type=imageType
image width=imageWidth
image height=imageHeight
image real size=imageRealSize
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
data properties={
minValue=minValue
maxValue=maxValue
columns=columns
rows=rows
mean value=mean
standard deviation=stddev
}
image properties ={
image type=imageType
image width=imageWidth
image height=imageHeight
image real size=imageRealSize
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: left offset for Image
position on stage
4: upper offset for Image
position on stage40030000thisSpritethisSprite
theStage
anotherSpriteStagea simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color
4: fill colorcontinuouscontinuous
dashed
dash-dot
dot-dot1thisSpritethisSprite
theStage
anotherSpritelineWidthlineStylelineColorfillColorif source is not SciSnap!Data data should have the image dimensions in the last row as (width,height,"dimensions").SciSnap!DataSciSnap!Data
currentCostume
anotherListthisSpritethisSprite
anotherSprite
theStageSciSnap!DatacurrentCostume013dimensionstypeOfDataRGBcolumns4imageWidth1imageHeight2myDatamyDatarowsmyDataminValueminmyDatamaxValuemaxmyDatameanmeanmyDatastddevstandard-deviationmyDatatypeOfDataFITSimageWidth1imageHeight2myDatamyDatarowsmyDatacolumns1minValueminmyDatamaxValuemaxmyDatameanmeanmyDatastddevstandard-deviationmyDataERROR: oops...anything went wrong!import image dataGenerates, adds or mixes an image (with offsets) from the FITS or RGB data (placed in myData) in different colors.createcreate
add
mixgraygray
red
green
blue
false-color
RGBfalse255255
0thisSpritethisSprite
anotherSprite
theStagetypeOfDataFITStypeOfDataRGBmyDatacolor1selection1RGBtypeOfDataRGBcreateoffsetstheStageStageimageWidththeStage2StageimageHeighttheStage2offsets00costumeWidthcostumeHeightSciS_addImageToImagePad(data,properties,color,log,alpha,pixels,selection)myDatamyPropertiesStageDraws a list of "points" in different "shapes". myDatacirclescircles
squares5thisSpritethisSprite
theStage
anotherSpritefalsefalse20sourcemyDatamatrix012source121lastvalueSciS_drawListOfPoints(costume,data,shape,size,properties,withNoise,range)myPropertiesSets the RGB or image data value at (x|y) on costume or myData of target. RGBRGB
image data in myDatathisSpritethisSprite
theStage
anotherSpritean appropriate valuefalsepositionx1y2vectorRGB34vectorlineColor1thisSpritefalsetrueReports the RGB value at the position (x|y) of the costume. RGB(A)RGB(A)
image data of myData =imageDatathisSpritethisSprite
theStage
anotherSpritefalsepositionx1y2costumeWidthcostumeHeight11RGB(A)typeOfDataRGBtypeOfDataFITSObtaining data with the mouse from an image stored in myData.imageValueimage value=imageValue
RGB value=RGBvalue
costume coordinates=costumeCoordinates
slice values from costume=costumeSlice
slice values from myData=dataSlice
line data=lineData
circle data=circleData
brightnessthisSpritethisSprite
theStage
anotherSpritefalseselection1isDraggabletargetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.imageValueimage value.11RGBvalueRGB value.11lineDataokfalseokfalsexold1yold2Stagedraggableline datacostumeSlicedataSliceslice datacircleDatacircle dataokfalseokfalseStagebrightnessbrightnessERROR: unknown selectionimageValue/... on ... by mouseApplies an affine transformation to a costume.
currentCostumefalseoktrueP11P22P33Q11Q22Q33S1221221220ERROR: denominator is zeroaffine transformation of costume ...Reports the brightness of a FITS or RGB image around x|y in a circle with radius r.
Attention: JS-coordinates are used!10myDatamyData
costumethisSpritethisSprite
theStage
anotherSpritefalsemyDatatypeOfDataFITStypeOfDataRGBSciS_brightness(data,xpos,ypos,r,width,height,typeOfData,typeOfArea)typeOfDatacircleRemoves the calling sprite.thisSpritethisSprite
anotherSpriteSciS_removeSprite(sprite)Selects a sprite as active.thisSpritethisSprite
theStage
anotherSpriteThis block is called by dynamically generated event handlers. You should define what is to happen for the corresponding sprites. Two examples are included for the LineTool and the SquareTool.thisSpritethisSprite
theStage
anotherSpritereceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessage110SquareToolTheNewSpritereceiveKey -20receiveInteraction clickedArthmetic with image data (FITS or RGB).
RGB data are normalized to the range 0 ..255.
The last element of the result contains the dimensions of the imagge.of image1100100++
-
*
/of image210010000imageType1vectorFITSmatrix1314RGBunknownunknownimageType2vectorFITSmatrix1314RGBunknownunknownunknownunknownSciS_imageArithmetic(image1,image2,imageType,xOffset,yOffset,width1,height1,width2,height2,operation)Configure the sprite as an ImagePad and load an image as costume!valuediagramAn image of Albategnius should be loaded as costume of the sprite!t0a0.1225positionStagecircles2theStagetruetrue100t1Creates an Infobox about this category. thisSpritethisSprite
theStage
anotherSpriteanotherSpriteanotherSprite
theStage
thisSprite1Stage size2Stage sizemyImagescurrentImagemyLineToolnot setmySquareToolscostumeWidthcostumeHeightthisSpritethisSprite
theStage
anotherSpriteaddadd
removethisSpritethisSprite
theStage
anotherSpritetruenextnext
first
last
any number = numberthisSpritethisSprite
theStage
anotherSpritetruemyImages1myImages0myImagesmyImageslightGraycurrentImagelightGraythisSpritethisSprite
theStage
anotherSpritelightGraycurrentImagethisSpritethisSprite
theStage
anotherSprite25currentImagenew sizecurrentImage5currentImagethisSpritethisSprite
theStage
anotherSprite1010currentImageimagecurrentImagethisSpritethisSprite
theStage
anotherSpritecurrentImageisDraggableoldMouseXoldMouseYStage coordinates are alternatively described as Snap! or JavaScript coordinates, window and image coordinates are always JavaScript coordinates.window-positionwindow-position
image-position
image-valuethisSpritethisSprite
theStage
anotherSpritefalsewindow-positionimage-positionimage-valueimageOffsetscurrentImageStageStagecurrentImageimageSizecurrentImage100NaNxi11yi22image-positionERROR: wrong selection!stage position --> ...Stage coordinates are alternatively described as Snap! or JavaScript coordinates, window and image coordinates are always JavaScript coordinates.window-positionwindow-position
image-positionthisSpritethisSprite
theStage
anotherSpritefalseselection1window-positionimage-positionimageSizecurrentImage100NaNimageOffsetscurrentImageStageStagecurrentImageresult1currentImageStage2StagecurrentImagethisSpritethisSprite
theStage
anotherSpriteposition1122Checks whether the specified sprite is in the list of deleted sprites.thisSpritethisSprite
anotherSpriteallTheSpriteserrorAttaches a sprite as part of another sprite.a partthisSpritethisSprite
anotherSpriteInitialization of SciSnap!800600EmptyHilbertoRight00Creates a text-file "SciSnap!Costumes" from present costumes.data""itemTEXTSciSnap!CostumesSciSnap!CostumesCreates and stores different SciSnap! costumes.ready!1Creates global variables "SciSnap!Properties", "SciSnap!Data", and "SciSnap!Messages".
Sets the default values of global SciSnap!-properties for items
typeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueSets the value of an existing property or inserts it anew.typeOfDatatypeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueReturns the value of an existing global SciSnap!-property or "".
Items:
typeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueminValuetypeOfData
width
height
minValue
maxValue
columns
rows
maxSetValueCreates a new empty costume of the specified size and color and sets the local properties.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalseleft
right15StagetypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesfillColor180180180myPropertiestextHeight12myPropertiestextOrientationtruemyPropertieswithCloseButtonmyPropertiescloseButtonLeftmyPropertiescloseButtonSizemyPropertiesbackColormyPropertiesfrontColor000myPropertiescostumeWidthmyPropertiescostumeHeightmyPropertieswidthmyPropertiesheightmyPropertiesoffsets22myPropertiescostume properties:
1: width
2: height
3: back color RGB
4: offsets for position on stage
5: front color RGB
line properties:
1: line width
2: line style
3: line color RGB
4: fill color RGB
text properties:
1: text height
2. orientation (horizontal=true)
closebutton properties:
1: with closebutton?
2: position (left=true)
3: closeButtonSizeTest on different SketchPad types.thisSpritethisSprite
theStage
anotherSpriteSketchPadSketchPad
MathPad
PlotPad
ImagePad
GraphPad
NNPad
GridPadmyPropertiesfalseReshapes and cleares the costume of a SketchPad.thisSpritethisSprite
theStage
anotherSprite400300SketchPadcostumeWidthmyPropertiescostumeHeightmyPropertiesoffsetsmyProperties22fillColorthisSpritebackColortheStagedrawStage2Stage2Stage2Stage2theStagefalsefillStage2Stage2Stage2Stage2theStagefalseDeletes a SketchPad.thisSpritethisSprite
anotherSpriteIf necessary, place the close button in the correct position.thisSpritethisSprite
anotherSpriteSketchPadmyCloseButtonnot setwithCloseButtontypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesdraw00false00false00false12222myCloseButtonThis block is used to create/remove dynamically tools for a window.createcreate
removelineline
a squarethisSpritethisSprite
theStage
anotherSprite30callerlineCreate or remove TheLineTool with its ends.myWindowTheLineToolisMovingTheLineToolfalseTheLineToolyellowreceiveInteraction pressedTheLineToolreceiveInteraction mouse-departedTheLineToollineEnd1newSpritethisSpriteLineEnd1LineEnd1isMovingLineEnd1falseLineEnd1SciS_changeToolCostume(size,tool,color)lineEnd1orangeRGB-value44receiveInteraction pressedLineEnd1receiveInteraction mouse-departedLineEnd1myLineEnd1TheLineToollineEnd2newSpritethisSpriteLineEnd2LineEnd2isMovingLineEnd2falseLineEnd2SciS_changeToolCostume(size,tool,color)lineEnd1magentaRGB-value44receiveInteraction pressedLineEnd2receiveInteraction mouse-departedLineEnd2myLineEnd2TheLineToollineColoryellowRGB-valuelineWidth2LineEnd1window-positiontrueLineEnd2window-positiontruefalseLineEnd2TheLineToolmyLineToolnot seta squaremySquareToolsmyWindowisActivefalse200SciS_changeToolCostume(size,tool,color)squareToolorangeRGB-valuereceiveInteraction pressedreceiveInteraction mouse-departedreceiveKey +receiveKey -receiveKey up arrowreceiveKey down arrowreceiveKey left arrowreceiveKey right arrowCreate or remove a SquareTool.showshow
hideTheLineToolTheLineTool
TheSquareToolthisSpritethisSprite
theStage
anotherSpriteTheLineTooltoolTheLineToolshowTheLineToolLineEnd1LineEnd2lineColoryellowRGB-valuelineWidth2LineEnd1window-positiontrueLineEnd2window-positiontruefalseLineEnd2TheLineToolTheSquareTooltoolTheSquareToolshowMoves tools to new positions corresponding to their image coordinates.thisSpritethisSprite
theStage
anotherSpriteTheLineToolLineEnd2TheLineToolshowTheLineToolTheSquareToolthisSpritethisSprite
theStage
anotherSpriteTheLineToolsquareToolmySquareToolsLineToolLineTool
SquareToolleftleft
right
up
downSquareToolleftTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolrightTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolupTheLineToolLineEnd2showTheLineToolmyWindowTheLineTooldownTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolCancels the connection between attached sprites.thisSpritethisSprite
anotherSpriteAdds an event handler to a sprite. Resets the event handler with the standard sprite operation if the script is empty.mouseClickLeftmouseDownLeft
mouseDownRight
mouseClickLeft
mouseClickRight
mouseDoubleClick
mouseEnter
mouseLeave
mouseEnterDragging
mouseLeaveDragging
mouseEnterBounds
mouseLeaveBounds
mouseMove
mouseScrollReports a string without first/all instances of substring.allall
firstthisthisStringReports a substring of a string.thisString14Deletes leading and trailing as parameter defined characters in a string...this string...0Reports the Euclidean distance of to points.Metric for Strings.SaturdaySundayDeletes any "remaining" close buttons.Sets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets for Image position=imageOffsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
1: text height=textHeight
2. orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}thisSpritethisSprite
theStage
anotherSpriteReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets for Image position=imageOffsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
1: text height=textHeight
2. orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}thisSpritethisSprite
theStage
anotherSpriteDraws a line on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.thisSpritethisSprite
theStage
anotherSpritefalseposition1position2Draws a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.drawdraw
fillthisSpritethisSprite
theStage
anotherSpritefalseposition1position2Draws or fills a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.drawdraw
fill20thisSpritethisSprite
theStage
anotherSpritefalseposition1Draws a text on present costume using line properties. The text is drawn horizontal or vertical. Coordinates can be used as Snap! or JS coordinates.my text12thisSpritethisSprite
theStage
anotherSpritefalseposition1Reports the width of the text, if drawn on a Sprite.my text18thisSpritethisSprite
theStage
anotherSpritei515025-2402Returns the content of a TEXT, CSV, RGB, JSON or FITS file from a URL. RGB-data should have the dimensions in the last row, otherwise use CSV.TEXTTEXT
CSV
RGB
JSON
FITSthis urlTEXTCSVRGBJSONFITSReturns the content of a TEXT, CSV, RGB, JSON or FITS file, selected with filepicker. RGB-data should have the dimensions in the last row, otherwise use CSV.TEXTTEXT
CSV
RGB
JSON
FITSTEXTTXTCSVRGBCSVJSONJSONFITSFITSFTSReturns a list with one or more elements consisting of [filename/BLOB].filefile
filelistReturns the content of a TEXT, CSV, JSON or FITS file. The "source" could either be a BLOB or a list of filename and BLOB. RGB-data should have the dimensions in the last row, otherwise use CSV.this filereadySciS_readFileAsBLOB(source)12Saves the data to a file of the specified type.SciSnap!DataSciSnap!Data
costumeData
other RGB dataTEXTTEXT
CSV
RGB
JSONthis fileTEXTCSVRGBJSONImports text, table-CSV-data, costume-data, JSON-data, or FITS-data from current costume, a file or an URL to SciSnap!Data.CSV-dataTEXT-data
CSV-data
RGB-data
JSON-data
FITS-data
TEXT-BLOB
CSV-BLOB
JSON-BLOB
FITS-BLOBfilepickercurrent-costume=costume
filepicker
URLisBLOB?1BLOBchoice11filepickercostumecostumeRGBCSVcostumetypeOfDataSciSnap!DatadatavaluewidthheightminValue1maxValuecolumns4rowsRGBTEXTJSONRGBCSV0RGB143dimensionstypeOfDataheightSciSnap!Data100001columnswidthrowsheightFITStruerowscolumns1times1011Adds a new entry to SciSnap!Messages, shows the error message, and stopps all.something wrong!thisBlockCreates a new empty costume of the specified size and color and sets local properties. thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsetrue15lightGraytypeOfConfigurationmyPropertiesGraphPadtypeOfDatanonemyPropertiesxLeft1myPropertiesxRightmyPropertiesyUpper1myPropertiesyLowermyPropertiesverticesMinRadius3myPropertiesverticesGrowingtruemyPropertiesverticesContentShownfalsemyPropertiesedgesDirectedfalsemyPropertiesedgesWithWeightstruemyPropertiesedgesShowWeightsfalsemyPropertiesinitialCostumenullmyPropertiesStagetruelineColortheStageblackRGB-valuedraw1offsetstheStage2offsetstheStage1offsetstheStage2offsetstheStagetheStagefalsetruelineColorblackRGB-valuedraw00falseinitialCostumeCostume attributes and line attributes same as SketchPad.
other attributes:
initial costume, maybe a map
vertex ranges for random coordinates
xLeft
xRight
yUpper
yLower
vertex properties:
minimal radius of a vertex (should be changed if vertices
are not growing with number of edges) = verticesMinRadius
vertices grow with number of connected edges = verticesGrowing
vertex content is shown (If there is no content the vertex number is shown) = verticesContentShown
edge properties:
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeightsthisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
initial costume=initialCostume
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
ranges for vertices={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
vertex properties={
minimal radius=verticesMinRadius
vertices can grow=verticesGrowing
vertices show content=verticesContentShown
}
edge properties={
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeights
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
initial costume=initialCostume
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
ranges for vertices={
x left=xLeft
x right=xRight
y lower=yLower
y upper=yUpper
}
vertex properties={
minimal radius=verticesMinRadius
vertices can grow=verticesGrowing
vertices show content=verticesContentShown
}
edge properties={
edge width=lineWidth
edge style=lineStyle
edge color=lineColor
fill color=fillColor
edges are directed=edgesDirected
edges have weights=edgesWithWeights
edges show weights=edgesShowWeights
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes.
1: width
2: height
3: back color 400300thisSpritethisSprite
theStage
anotherSpriteStagebackColorxLeft0.1xRight0.9yLower0.9yUpper0.1a simple way to set some vertex attributes:
1: ranges for random coordinates
(xLeft,xRight, yUpper,yLower)
2: minimal radius of a vertex, should be
changed is vertices are not growing
with number of edges
3: boolean: vertices grow with number
of connected edges
4: boolean: vertex content is shown.
If there is no content, the vertex
number is shown3truefalsethisSpritethisSprite
theStage
anotherSpriteverticesMinRadiusverticesGrowingverticesContentShowna simple way to set some edge attributes:
1: line width
2: line color
3: boolean: edge is directed
4: boolean: edge has a weight
5: boolean: edge shows
weight1falsefalsefalsethisSpritethisSprite
theStage
anotherSpritelineWidthlineColoredgesDirectededgesWithWeightsedgesShowWeightsadds a vertex at position. Snap!coordinates means: zero is in the middle of the graphthisSpritethisSprite
theStage
anotherSpritetrueoffsetsoffsetsposition1xLeft2yUpper1xRight2yLower4vertexListadds n vertices to the vertexList of a GraphPad:
Vertex attributes have the following order:
1: x
2: y
3: size
4: content
5: isMarked
6: colorNr
7: numberOfLinks
parameter 'null' means 'random vertices'1thisSpritethisSprite
theStage
anotherSpritedummySciS_addVerticesToGraph(n,amatrix,vlist,properties,point)adjacencyMatrixvertexListmyPropertiesnullMoves a vertex to another position measured in Snap! sprite-coordinates1thisSpritethisSprite
theStage
anotherSprite100truevertexList1vertexList12vertexList2Creates a new edge between two vertices.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListadjacencyMatrixXadjacencyMatrixXedgesDirectedCreates n new edges randomly.1thisSpritethisSprite
theStage
anotherSpriteresultSciS_addRandomEdgesToGraph(amatrix,n,properties,vlist)adjacencyMatrixmyPropertiesvertexListadjacencyMatrix1vertexList2draws the graph on a GraphPad.thisSpritethisSprite
theStage
anotherSpriteinitialCostumeinitialCostumeinitialCostumeinitialCostumeSciS_drawGraphOnGraphPad(amatrix,vlist,properties)adjacencyMatrixvertexListmyPropertiesinitialCostumeDeletes a vertex.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes an edge.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListadjacencyMatrix0edgesDirected12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListSets the weight of an edge.121thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListthisSpritethisSprite
theStage
anotherSpritefrom vertex nrInput for start vertex.thisSpritethisSprite
theStage
anotherSpritenew start vertexwidth (1....20)1thisSpritethisSprite
theStage
anotherSprite0vertexListSets the content of a vertex.1thisSpritethisSprite
theStage
anotherSprite0vertexListInput for a new vertex content.thisSpritethisSprite
theStage
anotherSpritevertex numberTells a vertex to be marked.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes a marker.1thisSpritethisSprite
theStage
anotherSprite0vertexListDeletes all markers.thisSpritethisSprite
theStage
anotherSpriteitemvertexListDepth first search in a graph.1thisSpritethisSprite
theStage
anotherSprite0vertexListBreadth first search in a graph.1thisSpritethisSprite
theStage
anotherSprite0vertexListReports the Euclidean distance of two vertices.thisSpritethisSprite
theStage
anotherSprite120vertexList0vertexListShortes path between two vertices, using Dijkstra-method.12thisSpritethisSprite
theStage
anotherSprite0vertexList0vertexListShortes paths between startVertex and all connected vertices, using Dijkstra-method.1thisSpritethisSprite
theStage
anotherSprite0vertexListReturns the vertexnumber of a vertex near (x|y), if there is one.thisSpritethisSprite
theStage
anotherSpritetruepositionoffsetsoffsetsSciS_vertexnumberAtGraph(vlist,properties,position)vertexListmyPropertiesReports the vertexnumber of the vertex with the specified content. If not found then reports 0.PeterthisSpritethisSprite
theStage
anotherSpritenr0itemvertexList0meanmeancolumn2thisSpritetrue12numberXdiagramSpriteduplicateDiagramSpriteDiagramSprite400300lightGrayfalsetrue15DiagramSpriteEdges per Node18Number of Edges16Number of Vertices166DiagramSpritetrueDiagramSpriteCreates a new empty costume of the specified size and color ans sets local properties for a NeuralNet.thisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15costume properties:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for NN position on stage
7: upper offset for NN position on stage
neural net properties:
1: number of layers
2: layer width
3: width of NN
4: height of NNthisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.numberOfLayerstypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
net properties={
number of layers=numberOfLayers
layer width=layerWidth
net width=netWidth
net height=netHeight
input list=inputs
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.numberOfLayerstypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
net properties={
number of layers=numberOfLayers
layer width=layerWidth
net width=netWidth
net height=netHeight
input list=inputs
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color
4: offsets for NN position on stage400300thisSpritethisSprite
theStage
anotherSpriteStagenetWidthnetHeightoffsets00backColora simple way to set net attributes:
1: number of layers
2: layer width23thisSpritethisSprite
theStage
anotherSpritenumberOfLayerslayerWidthCreates a fully connected neural network of perceptrons. Inputs should be connected to layer 1, outputs to last layer.23thisSpritethisSprite
theStage
anotherSpritemyDataone matrix for each layer1myDatanumberOfLayerslayerWidthReports the output of the nth layer of a neural network with given input.last1
lastthisSpritethisSprite
theStage
anotherSpriteinputinputs0vectorlayerWidthDraws the nodes and current status of connections of an NN as new costume.thisSpritethisSprite
theStage
anotherSpriteinputinputs0layerWidthSciS_NNshowStatus(properties,weights,outputs,costume,isStage)myPropertiesmyDataStageA block for teaching a neural net.0.1thisSpritethisSprite
theStage
anotherSpritewidthlayerWidththisSpritethisSprite
theStage
anotherSpriteCreates a new empty costume of the specified size and color and sets local propertiesthisSpritethisSprite
theStage
anotherSprite400300lightGrayblack
gray
lightGray
white
red
orange
yellow
green
cyan
blue
magentafalsefalse15redgreenbluegrayorangecyanmagentayellowwhitetruemyData1010myDataCostume attributes and line attributes same as SketchPad.
other attributes:
numberOfGridColumns
numberOfGridRows
cellWidth
cellHeight
cellColors
1: black
2: red
3: green
4: blue
5: gray
6: orange
7: cyan
8: magenta
9: yellow
10: lightGray
11: white
Reports whether the sprite is configured as a GridPad.thisSpritethisSprite
theStage
anotherSpriteSets the value of an existing property or inserts it anew.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
line properties={
line width=lineWidth
line style=lineStyle
line color=lineColor
fill color=fillColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
grid proterties={
number of grid columns=numberOfGridColumns
number of grid rows=numberOfGridRows
cell width=cellWidth
cell height=cellHeight
cell colors=cellColors
with grid lines=withGridLines
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesReads the value of an existing property.typeOfConfigurationtypeOfConfiguration
typeOfData
costumeProperties={
width=costumeWidth
height=costumeHeight
back color=backColor
offsets=offsets
front color=frontColor
}
text properties={
text height=textHeight
orientation=textOrientation
}
closebutton properties={
with closebutton?=withCloseButton
position=closeButtonLeft
size=closeButtonSize
}
grid properties={
number of grid columns=numberOfGridColumns
number of grid rows=numberOfGridRows
cell width=cellWidth
cell height=cellHeight
cell colors=cellColors
with grid lines=withGridLines
}thisSpritethisSprite
theStage
anotherSpritemyPropertiesa simple way to set some costume attributes:
1: width
2: height
3: back color red
4: back color green
5: back color blue
6: left offset for Image
position on stage
7: upper offset for Image
position on stage40030000thisSpritethisSprite
theStage
anotherSpriteStagea simple way to set some net attributes:
line properties:
1: line style
2: lineWidth
3: line color
4: fill colorcontinuouscontinuous
dashed
dash-dot
dot-dot1thisSpritethisSprite
theStage
anotherSpritelineWidthlineStylelineColorfillColora simple way to set some grid attributes:
1: number of horizontal cells
2: number of vertical cells
3: cell width
4: cell height
grid data are stored in myDatathisSpritethisSprite
theStage
anotherSprite403011truewhcostumeWidthwscostumeHeight11numberOfGridRowsnumberOfGridColumnscellWidthcellHeightcellHeightwithGridLinesmyDatamyDataDraws a grid on an GridPad.myDatathisSpritethisSprite
theStage
anotherSpritemyDatamatrixnumberOfGridColumnsthisSprite1numberOfGridRowsthisSpriteSciS_addGridToGridPad(costume,properties,withLines,data)myPropertieswithGridLinesFills a grid or a part of a grid with one of the specified values.thisSpritethisSprite
theStage
anotherSprite1xMax1yMaxxMaxyMaxmyDataSciS_fillOnGridPadGridRandomlyOnImagePad(xMin,xMax,yMin,yMax,numbers,data)myDatamyDatasets the value of a grid cellthisSpritethisSprite
theStage
anotherSprite1targetCostumetargetCostumeWidthtargetCostumeHeightStage11myDataObtaining data with the mouse from a grid stored in myData.cellValuecell value=cellValue
cell coodinates=cellCoordinates
costume coordinates=costumeCoordinatesthisSpritethisSprite
theStage
anotherSpriteselection1targetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.cellCoordinatescoordinates of a grid cellcellValuevalue of a grid cellSets the value of a grid cell an shows the result.thisSpritethisSprite
theStage
anotherSprite112true11numberOfGridColumnsnumberOfGridRowsthisSpritethisSprite
theStage
anotherSprite1111numberOfGridColumnsnumberOfGridRowsReports the Moore- or v.-Neumann-neighborhood of a cell.
Order: north,east,south,westMooreMoore
vonNeumannfalse11thisSpritethisSprite
theStage
anotherSpriteSciS_neighborhoodInGridOnImagePad(data,properties,x,y,isTorus,typeOfNeighborhood)myDatamyPropertiesSwaps the cell values of a grid randomly.thisSpritethisSprite
theStage
anotherSpritetrue111xMax1yMaxxMaxyMax1numberOfGridColumns1numberOfGridRowsSciS_swapCellsOfGridOnGridPad(data,n,isTorus,range,xMin,xMax,yMin,yMax)myDataCounts the surrounding values and changes it if necessary.thisSpritethisSprite
theStage
anotherSpritetrueanyany22greater-thangreater-than
equal-to
smaller-than
different-from41false51xMax1yMaxxMaxyMaxSciS_changeSurroundingValuesOfGridOnGridPad(data,ifValue,elseValue,surrValue,op,n,isTorus,withNoise,noise,xMin,xMax,yMin,yMax,oldValue)myData11Replaces the cell values of a grid depending on the features of the neighbors.thisSpritethisSprite
theStage
anotherSpritetruesumsum
min
max
mean1xMax1yMax1xMaxyMaxSciS_replaceValuesOfGridOnImagePad(data,operation,isTorus,xMin,xMax,yMin,yMax,range)myData1Combines two grids.1orand
or
xor
not-and
not-or
not-xor
minus212xMax1111yMaxSciS_combineGridsOnGridPad(grid1,grid2,value1,operator,value2,ifValue,elseValue,xMax,yMax)Sets the size of a sprite so that it fits into the specified stage area.thisSpritethisSprite
anotherSprite-200200200-200spriteWidthspriteHeightwindowWidthwindowHeightStage100100thisSpritethisSprite
theStage
anotherSpriteJavaScriptJavaScript
Snap!positionJavaScript12thisSpritethisSprite
theStage
anotherSpritereceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessageangle: LineEnd12receiveInteraction mouse-departedisMovingTheLineToolmyWindowTheLineToolLineEnd1receiveInteraction mouse-departedisMovingLineEnd1myWindowTheLineToolLineEnd2receiveInteraction mouse-departedisMovingLineEnd2myWindowTheLineToolTheSquareToolreceiveInteraction scrolleddownTheSquareToolreceiveGoreceiveGo
receiveKey enter
receiveKey space
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessage
getDatasize/55isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valueSciS_changeToolCostume(size,tool,color)squareToolorangeRGB-value16getDatareceiveInteraction mouse-departedreceiveKey +isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valuereceiveKey -isActiveSciS_changeToolCostume(size,tool,color)squareToolgreenRGB-valuereceiveKey left arrowisActivereceiveKey right arrowisActivereceiveKey up arrowisActivereceiveKey down arrowisActive20theWindow3320theWindowremoveline15createline15TheLineTool20theWindownewSpritethisSpriteTheWindow-200150Activate SquareTools by mouseclick, enlarge or reduce activated SquareTools by +/- keys, move them by arrow keys. Get data by shift-click on a SquareTool.createa squareTheWindow501mySquareToolscreatea squareTheWindow50createa squareTheWindow50Random graphic, inspired by "Merzbild 1a - the psychiatrist"
painted by Kurt Schwitters.20502050lightGrayStageHilbertoLeft350-250The reaction of the sprite must be defined in the block "let <sprite> respond to <event>".5Hilbertochoose costumereceiveKey +add three event handlerreceiveKey -receiveInteraction clickedLet me grow/shrink by pressing the +/- buttons or delete me by mouse click.choose costumeConverts a variadic position parameter into a position.Converts a variadic color parameter into a RGB(A)-value.41truetrueCurrently not used.any textApplies a Wolfram Cellular Automaton to a grid.3031SciS_applyWolframAutomatonToAgridOnGridPad(no,grid,color0,color1)Reports whether the set is numerical or not.this set2Installs an event handling method for a sprite.receiveGoreceiveGo
receiveKey enter
receiveKeyspace
receiveKey +
receiveKey -
receiveKey up arrow
receiveKey down arrow
receiveKey left arrow
receiveKey right arrow
receiveInteraction clicked
receiveInteraction pressed
receiveInteraction mouse-entered
receiveInteraction mouse-departed
receiveInteraction scrolled up
receiveInteraction scrolleddown
receiveMessagethisSpritethisSprite
theStage
anotherSpritecallerxml<script app="Snap! 9.0, https://snap.berkeley.edu" version="2"><script><block s="Go0Key0receiveMessage0receiveInteraction0xml</block><custom-block s="let %s respond to %s"><block s="reportObject"><l><option>myself</option></l></block><l></l></custom-block></script></script>Extracts the words in upper case from a text, e.g. for statistical analysis or cryptographic purposes. AZReports a list [p(category1), p(category2), LagrangeSmoothing1, LagrangeSmoothing2, probabilities1, probabilities2) for naive Bayes classification of texts.pCat1pCat2text11i2text21i2text1text2countedWords110countedWords210vocabulary1column1truevocabulary2column1truetotal vocabularylengthTotalVocabularylengthVocabulary1lengthVocabulary2conditional probabilities1valueconditional probabilities2value11this textresult1factor6result212resulti§_dynamicMenucatYou can use this block to delete or create your own categories. For security reasons, JavaScript must be activated for this.removeremove
create
hide all blocks
show all blocks§_dynamicMenu0116143truecreatehide all blocksshow all blockscathidehide
showA simple example for a SciSnap!-configuration: some categories are removed and some blocks are hidden.hidehidehidehidehidekey,valuetypeOfData,not setwidth,not setheight,not setminValue,not setmaxValue,not setcolumns,0rows,0maxSetValue,500<transpose vector or matrix> signals: ERROR: structure is not rectangular! ,<transpose vector or matrix> signals: ERROR: structure is not rectangular! ,<transpose vector or matrix> signals: ERROR: vector or matrix required! ,<transpose vector or matrix> signals: ERROR: structure is not rectangular! ,<remove/create category> signals: ERROR: unknown category! ,<remove/create category> signals: ERROR: unknown category! key,valuelineStyle,continuouslineColor0,0,0fillColor180,180,180textHeight,12textOrientationtruewithCloseButtonfalsecloseButtonLeftfalsecloseButtonSize,15backColor230,230,230frontColor0,0,0costumeWidth,400costumeHeight,300width,400height,300offsets0,0typeOfConfiguration,MathPadlineWidth,1onlyPointsfalsedimensions,2xMin,-10xMax,10yMin,-10yMax,10zMin,-10zMax,10startPoint0,0withGrid?,0typeOfData,complex-numbernot set
\ No newline at end of file