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 anotherSpritespriteNamewhat1 existingSpritesSciS_createObject(operation,sprite,spriteName)itemsomething wrong!create new sprite of sprite
Imports a stored sprite from a file selected with filepicker.
Returns "true" if JavaScript is enabled, else "false".
error
Returns "true" if the key no. n is pressed, else "false".
27
Reports 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.6001172099531121531101215821260360024
Input 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)102018truefalsei1draw2530505false281218truefalsedraw70301005falseok751218truefalseokfalse70100305oktrue0
Allows 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 palette
Allows 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 draggabletrue
Reports 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 ... --> number
Reports the row or column name of the row or column with the number entered, or reports an error message.
columncolumn row1SciSnap!Datatable0columnrow
Evaluates the predicate with a given parameter.
ringified predicate
Evaluates the intervals with a given parameter.
ringified predicateinterval3<false
falseimplies -->implies --> is equivalent to <-->trueis equivalent to <-->ERROR: something went wrong!
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
2resultn1
1141413<232<3<2<4414142<323<2<3<true
3231111111111212121212121212
11resultn1m1n1
11resultn1
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
11define left edge and operator44define right edge and operator
0listOfIntervalsitemfalse
Returns 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)355i132305
Returns all elements of a list not covered by the intervals.
Test wether the predicate is translatable to a list of intervals.
ringified predicate1comparisonOperator1123value32value2false
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
interval1interval2intersection0result1144341444341444
determines intervals1 \ intervals2
resultm1n1m1
resultinterval
resultinterval01predicate12i3
2<3<
intervalsi1
Shows the message with headline in the middle of the window.
headlinetheMessage
Reports a vector, built by the items.
Returns a new vector of dimension n with random elements.
3110
Returns a matrix formed from the input vectors.
length1transposed?1column-vectorresultvector
Returns a new nxm-matrix with random elements.
32110i1
Creates the transpose of a vector, matrix, or table.
vector or matrix0
Determines a property of a matrix or vector.
minmin max minpos maxpos number sum mean median variance standard-deviation softmaxmatrix or vectorchoice1 vectordatasoftmaxmedianminmaxnumbersummeanminposposY1maxposposY1variancestandard-deviationstandard-deviationERROR: unknown option!... of matrix or vector
Linear 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 operation
Applies a mapping matrix to an object that is given as a matrix of points.
matrixlist of points
Solves a linear system of max. 50 equations.
matrixcolumn vectorcolumn-vector01bmatrixcreate matrix with attached column bsolvedtrue50columncreate matrix with attached column bdTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonalizer1
Reports 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 E
Calculates 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 row1k11k1k1diagonaizer1
Calculates the value of a polynomial for input x.
polynomial as list of coefficients11result12i3
Applies 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.
23
Reports a complex number in polar form.
230
Reports a complex number in polar or Cartesian form.
complex numberpolarpolar Cartesian
Reports properties of complex numbers.
real-partabsolute-value real-part imaginary-part phase conjugatecomplex numberreal-partimaginary-partphaseconjugateERROR: unknown operator!... of complex number
Reports arithmetic results of two complex numbers.
z1++ - * /z2complex-numbercomplex-number-polar-formcomplex-number-polar-form+-*/cnC22333223
Creates 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 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 arrows
Reports 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 script
Reports 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-value4truetruetrue
Returns 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 magenta
Reports true if the varname is part of the scope of the sprite. the varname is not used case-sensitive!
varnamethisSpritethisSprite theStage anotherSpritevar_names(scope)sprite
Sets 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 anotherSpritemyProperties
Returns 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 anotherSpritemyProperties
a 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 properties
40030000truefalse15thisSpritethisSprite theStage anotherSpriteoffsetsmyProperties
a 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 arrows
1false3-1010-1010-1010000thisSpritethisSprite theStage anotherSpriteoldDimensionsdimensionsmyPropertiesoldXmaxxMaxmyPropertiesoldXminxMinmyPropertiesoldYmaxyMaxmyPropertiesoldYminyMinmyPropertiesoldZminzMinmyPropertiesoldZmaxzMaxmyPropertiesoldWithGrid?withGrid?myPropertieslineWidthmyPropertiesonlyPointsmyPropertiesdimensionsmyPropertiesxMinmyPropertiesxMaxmyPropertiesyMinmyPropertiesyMaxmyPropertieszMinmyPropertieszMaxmyProperties321withGrid?myPropertiescostumeWidthcostumeHeightbackColor
Draws 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-of
Draws members of a set.
set1blackblack gray lightGray white red orange yellow green cyan blue magenta11thisSpritethisSprite theStage anotherSpritesetdimensionsmyProperties115propertiesmyPropertieswidthwidthheightheightxminxMinxmaxxMaxleftOffset1offsetsupperOffset2offsetsdl305level30x0lineColorlineWidthSciS_MathPadPlotSet(set,setname,properties,atY,costume)myProperties20
Changes the name of a costume.
a costumenew costume nametrue
Adds 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 palette
Sets a local variable of a sprite to the specified value.
varnamethisSpritethisSprite theStage anotherSpriteanyValue
Reports the value of a local variable.
varnamethisSpritethisSprite theStage anotherSpriteERROR: variable don't exist.get ... of sprite
This 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 filepickerJSON
Reports a copy of a costume.
a costume
Reports the costume of a sprite or the stage.
thisSpritethisSprite theStage anotherSpritecostume
Displays a list in a dialog window.
This command closes all open dialog windows in a brutal way. ;-)
error
Catch 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.
0
Selects 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-resize
Test 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-formlistOfIntervalstrueset234listOfIntervals55numericalListresult0falsefalse
Returns a random number between 0 and 1.
Reports Pi.
Reports Euler's number.
The factorial function.
Reports a binomial coefficient.
531result1n1i1
Rounds value x to n digits.
1.23572
Reports a string with replacement instead of substring.
allall firstthisthatthisString
Reports the index of first appearance of substring in string.
ringthisString
Returns a root of an equation calculated with Newton's method.
ringified term1epsilon0.00001i11000
Reports an element of a sequence.
ringified term1
Returns a list of the first n elements of a sequence.
1ringified term1
Returns a list of secant slopes calculated with the given sequence.
ringified term21/n1/nelement
Reports the secant slope "nearby" the given point.
ringified term1epsilon0.00001
Returns a finite sum.
10ringified term0result0i
Returns the integral of a term calculated with n trapezoids.
2ringified term11000dxx11
Reports either - data Fourier transformed to frequency-space - "raw" FFT (Fast Forier Transformation) data formatted as SciSnap! complex numbers - or iFFT real data
frequency_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.
132
Reports coefficient of the normal distribution.
101
The 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>.
230
Creation 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≤ <≤ <InfinityInfinitysettrue
Creation 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 predicatepredicateTree
Reports whether "element" is element of "set".
elementsetset
Reports the intersection, union, difference, or cross product of two sets.
set1∩ ∪ \ Xset2are these two sets?set4044455555\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.Xset2233
Is set1 subset of set2?
set1set2are these two sets?set555intervalelement3Compare elementstrue
Are theses two sets equal?
set1set2set
Reports up to n elements of a set. Numers are natural numbers smaller than maxSetValue in SciSnap!-properties.
10setresult3405i1maxSetValue should be close to infinity ;-)resultvalueindexlistclean up1
Reports the enumerated elements and numbers written as intervals of the set.
elementselements intervals predicatethis setelementsintervalspredicatetrue
Returns the value of the left or right edge of an interval.
leftleft right
Reports simple types, sets and lists as string.
5i1maxSetValue should be close to infinity ;-)elementsvalueindexlist20item18is first elementtrueitem18ERROR: no simple type!elements --> text
Converts a string to a list of elements.
1,2,[3,4],{6,7,8..12}]10]0]0}10}0}0find lists
Returns an empty table.
Reports the copy of a list or an empty list.
table or list
Type conversions
table or listCSVDATAASTEXT CSV JSON
Reports a new table initialized with value.
23a valueresult
Reports a table with labeled columns.
23i1rowERROR: labels required!new ... table with labels
Reports randomly distributed points in the form of a rectangle, circle, or ring.
100-100100-100100squaresquare circle ringcirclering
Creates new random data in the specified ranges swaying by a straight.
10-55102
Generates a list of points "near" a given graph.
20-552
Reports 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!Datatruechoice1 tablerowlast1columnlast11ERROR: something wrong!row/column of data
Adds a row, a column, or column headers to a table.
rowrow column column-headersa listSciSnap!Datachoice1 tablerowi1column0i1column-headersi11
Deletes 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!Datatablerowlastcolumnlast11item
Reports the element a position x|y of a table, identified by numbers or names.
numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001
Replaces the value at position x|y of a table.
numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001
Reports 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-from
counts the appearances of the values of a list or table.
a table or list
Reports a sorted list.
a list
returns the entropy of a list of data
a table or list
Copy 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!Datatable
Normalizes a table by dividing it by the specified value.
SciSnap!Datameanmean max number sum median softmaxchoice1 vector0
Reports a vector or matrix with compressed columnsonly columns .
SciSnap!Data2isMatrixmatrixvector11resulti11iresultcolumnNr11
Pooling operation with matrices, images and vectors. On the top of the result are the new dimensions.
maxmax meanSciSnap!Data21typeOfPooling1 matrixvectorFITSRGBmatrixFITSRGBSciS_pooling(data,width,height,typeOfPooling,stride,typeOfData)
Sorts a list or table.
SciSnap!DatanumberOrNametruetrueisTabletable1result1
Determines a group of properties of a table.
meanmin max number sum meannumberOrNameSciSnap!DatanumberOrNametruetablegroupcolumncolumn11valuecolumncolumn11choice1 copytrue0SciS_groupeddata(aTable,compaircolumn,operation,groupcolumn)
Calculates the ranges, the covariance or the correlation between two columns of a table.
rangesranges covariance correlationnumberOrNamenumberOrNameSciSnap!Datatruetablencolumn11mcolumn11copychoice1 1SciS_propertiesoftable(selection,table,x,y)1
Calculates the parameters of a regression line.
SciSnap!DatamatrixsumX0sumY0numerator0denominator0dummymeanXmeanYdummymb
Determines 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-data114
Applies 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 centers
labels of data: -1 not visited, 0 visited, -2 noise, >0 clusternr
SciSnap!Data505matrix2SciS_DBSCAN(data,r,minMembers)-1
reports an ID3 decision tree constructed on the base of labeled data
SciSnap!Datatablewrong data0empty datasetSciS_ID3Tree(data)
returns the class of a dataset using an ID3-decision-tree
datathis 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 border
Reports whether the sprite is configured as a PlotPad.
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a 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 anotherSpriteStage
Sets the labels and textheights of the diagrams of a PlotPad and redraws them.
thisSpritethisSprite theStage anotherSpriteDiagram Title18x-label16y-label16titlexLabelyLabeltitleHeightxLabelHeightyLabelHeight
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color red 4: line color green 5: lineColor blue
continuouscontinuous dashed dash-dot dot-dot rainbow inverse-rainbow1thisSpritethisSprite theStage anotherSpritelineStylelineWidthlineColor
a 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 blue
squarenone o_circle ._point +_plus x_ex square triangle5falsethisSpritethisSprite theStage anotherSpritemarkerStylemarkerWidthmarkerConnectedmarkerColor
Sets some properties for scales and redraws them.
2212121010thisSpritethisSprite theStage anotherSpritefalsescalesXprecisionscalesYprecisionscalesXtextheightscalesYtextheightscalesXintervalsscalesYintervalsscalesXstartxLeftscalesXstepxRightxLeftscalesXintervalsscalesXscaling1scalesXminitics1scalesYstartyLowerscalesYstepyUpperyLowerscalesYintervalsscalesYscaling1scalesYminitics1
Sets the distances of the diagram axes to the edges of the Sketchpad.
thisSpritethisSprite theStage anotherSpriteupperOffset1scalesXtextheighttitle0scalesTiclength0lowerOffset1scalesXtextheightscalesYcenteredrightOffset1.5scalesYtextheightscalesTiclength0leftOffset1scalesYtextheightscalesXcenteredscalesTiclength0scaleLeftOffsetscaleRightOffsetscaleUpperOffsetscaleLowerOffset
Sets the ranges for the axes of the diagrams of a PlotPad and redraws it..
-1010-1010false0.1thisSpritethisSprite theStage anotherSpritepretty
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws a histogram of histogram data.With a lot of additions by Rick Hessman. Thanks!
myData10thisSpritethisSprite theStage anotherSpritetruemyDatavector0costumestart0transposed-vectorminmaxdeltah2resulti1221i1histgramData0prettySciS_addHistogramToPlotpad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentry
Draws and labels the axes of a PlotPad. With lot of additions of Rick Hessman. Thanks!
thisSpritethisSprite theStage anotherSprite
Clears the plot area of a PlotPad.
plotAreaplotArea plotData costumethisSpritethisSprite theStage anotherSpriteoldFillColorfillColorfillColorbackColorplotAreacostumeplotDatafillColor
Restores the last plotson the PlotPad.
thisSpritethisSprite theStage anotherSpriteplotplots1numericData1mixedData1histogram
Sets 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).scalingintervalsprecisionminitics
thisSpritethisSprite theStage anotherSpritemyData0.1myData2dy43xLeft1xRight2yLower3yUpper4scalesXstart1scalesXstep21scalesXintervalsscalesXscaling1scalesXminitics1scalesYstart3scalesYstep43scalesYintervalsscalesYscaling1scalesYminitics1
Calculates the ranges of two columns of a table.
Conversion of coordinates.
100xpxp yp x ythisSpritethisSprite theStage anotherSpritediagramWidthscaleLeftOffsetdiagramHeightscaleLowerOffsetscaleUpperOffsetx0xLeftxLeftxRighty0yUpperyUpperyLowercoordinate1 xpypxy
Obtaining coordinates of a PlotPad at mouseposition.
costume-coordinatescostume-coordinates graph-coordinatesthisSpritethisSprite theStage anotherSpriteselection1 targetCostumetargetCostumeWidthtargetCostumeHeighttargetXPositiontargetYPositiontargetSizecostume-coordinatescostume coordinates.graph-coordinatescostume coordinates.
400300continuouso_circle0
400300continuous
00600400continuousnone continuous dashed dash-dot dot-dot rainbow inverse rainbowsquarenone o_circle ._point +_plus x_ex square triangle0thisSprite0.07thisSpritethisSprite18161615thisSpritethisSprite
Changes the spritename.
thisSpritethisSprite anotherSpritenew nameSciS_changeSpritenameTo(sprite,newName)
Reports a list of sprites with similar names. Used when "cleaning up".
thisName
Checks whether an element is anywhere in a list.
this valuefalse
Creates 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=connect12ok0115ERROR
Reports a list of databases on the server and sets the corresponding properties.
databasesconnection&type=getDBs000115ERROR
Selects one of the databases and sets the corresponding properties.
2databasescurrentDatabasedatabasesdummyconnection&command=USE currentDatabasetablestablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERROR
Reports a list of tables of the chosen database and sets the corresponding properties.
tablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERROR
Selects one of the tables and sets the corresponding properties.
1tables0115ERROR
Reads the attributes of the specified table and sets the corresponding properties.
1tables0115ERROR
Generates a simplified SQL query.
* DISTINCTi11result FROM 0result2
Generates an almost complete SQL query.
* DISTINCTASCASC DESC10i11result FROM 0result20result20resultASC
Executes an SQL query.
1:ERRORreplaces "%" with "%25" to prevent trouble with the url-block.resultconnection&type=query&query=&database=currentDatabase
Imports the results of an SQL-query to SQLData and sets the corresponding properties.
typeOfDatatable0minValuenot setmaxValuenot set
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 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.
10anything
Inspired by Jackson Pollock ;-)
StageStage220200225
Creates 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 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 anotherSprite
Reads 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 anotherSpritemyProperties
Sets 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 anotherSpritemyProperties
a 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 stage
40030000thisSpritethisSprite theStage anotherSpriteStage
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color 4: fill color
continuouscontinuous dashed dash-dot dot-dot1thisSpritethisSprite theStage anotherSpritelineWidthlineStylelineColorfillColor
if 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 data
Generates, 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 theStagetypeOfDataFITStypeOfDataRGBmyDatacolor1 selection1 RGBtypeOfDataRGBcreateoffsetstheStageStageimageWidththeStage2StageimageHeighttheStage2offsets00costumeWidthcostumeHeightSciS_addImageToImagePad(data,properties,color,log,alpha,pixels,selection)myDatamyPropertiesStage
Draws a list of "points" in different "shapes".
myDatacirclescircles squares5thisSpritethisSprite theStage anotherSpritefalsefalse20sourcemyDatamatrix012source121lastvalueSciS_drawListOfPoints(costume,data,shape,size,properties,withNoise,range)myProperties
Sets the RGB or image data value at (x|y) on costume or myData of target.
RGBRGB image data in myDatathisSpritethisSprite theStage anotherSpritean appropriate valuefalsepositionx1y2vectorRGB34vectorlineColor1thisSpritefalsetrue
Reports the RGB value at the position (x|y) of the costume.
RGB(A)RGB(A) image data of myData =imageDatathisSpritethisSprite theStage anotherSpritefalsepositionx1y2costumeWidthcostumeHeight11RGB(A)typeOfDataRGBtypeOfDataFITS
Obtaining 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 anotherSpritefalseselection1 isDraggabletargetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.imageValueimage value.11RGBvalueRGB value.11lineDataokfalseokfalsexold1yold2Stagedraggableline datacostumeSlicedataSliceslice datacircleDatacircle dataokfalseokfalseStagebrightnessbrightnessERROR: unknown selectionimageValue/... on ... by mouse
Applies 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)typeOfDatacircle
Removes the calling sprite.
thisSpritethisSprite anotherSpriteSciS_removeSprite(sprite)
Selects a sprite as active.
thisSpritethisSprite theStage anotherSprite
This 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 clicked
Arthmetic 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!
valuediagram
An image of Albategnius should be loaded as costume of the sprite!
t0a0.1225positionStagecircles2theStagetruetrue100t1
Creates an Infobox about this category.
thisSpritethisSprite theStage anotherSpriteanotherSpriteanotherSprite theStage thisSprite1Stage size2Stage sizemyImagescurrentImagemyLineToolnot setmySquareToolscostumeWidthcostumeHeight
thisSpritethisSprite theStage anotherSprite
addadd removethisSpritethisSprite theStage anotherSpritetrue
nextnext first last any number = numberthisSpritethisSprite theStage anotherSpritetruemyImages1myImages0myImagesmyImageslightGraycurrentImagelightGray
thisSpritethisSprite theStage anotherSpritelightGraycurrentImage
thisSpritethisSprite theStage anotherSprite25currentImagenew sizecurrentImage5currentImage
thisSpritethisSprite theStage anotherSprite1010currentImageimagecurrentImage
thisSpritethisSprite theStage anotherSpritecurrentImageisDraggableoldMouseXoldMouseY
Stage 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 anotherSpritefalseselection1 window-positionimage-positionimageSizecurrentImage100NaNimageOffsetscurrentImageStageStagecurrentImageresult1currentImageStage2StagecurrentImage
thisSpritethisSprite theStage anotherSpriteposition1122
Checks whether the specified sprite is in the list of deleted sprites.
thisSpritethisSprite anotherSpriteallTheSpriteserror
Attaches a sprite as part of another sprite.
a partthisSpritethisSprite anotherSprite
Initialization of SciSnap!
800600EmptyHilbertoRight00Hi!2
Creates a text-file "SciSnap!Costumes" from present costumes.
data""itemTEXTSciSnap!CostumesSciSnap!Costumes
Creates and stores different SciSnap! costumes.
ready!1
Creates 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 maxSetValue
Sets the value of an existing property or inserts it anew.
typeOfDatatypeOfData width height minValue maxValue columns rows maxSetValue
Returns the value of an existing global SciSnap!-property or "". Items: typeOfData width height minValue maxValue columns rows maxSetValue
minValuetypeOfData width height minValue maxValue columns rows maxSetValue
Creates 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: closeButtonSize
Test on different SketchPad types.
thisSpritethisSprite theStage anotherSpriteSketchPadSketchPad MathPad PlotPad ImagePad GraphPad NNPad GridPadmyPropertiesfalse
Reshapes and cleares the costume of a SketchPad.
thisSpritethisSprite theStage anotherSprite400300SketchPadcostumeWidthmyPropertiescostumeHeightmyPropertiesoffsetsmyProperties22fillColorthisSpritebackColortheStagedrawStage2Stage2Stage2Stage2theStagefalsefillStage2Stage2Stage2Stage2theStagefalse
Deletes a SketchPad.
thisSpritethisSprite anotherSprite
If necessary, place the close button in the correct position.
thisSpritethisSprite anotherSpriteSketchPadmyCloseButtonnot setwithCloseButtontypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesdraw00false00false00false12222myCloseButton
This 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-positiontruefalseLineEnd2TheLineToolTheSquareTooltoolTheSquareToolshow
Moves tools to new positions corresponding to their image coordinates.
thisSpritethisSprite theStage anotherSpriteTheLineToolLineEnd2TheLineToolshowTheLineToolTheSquareTool
thisSpritethisSprite theStage anotherSpriteTheLineToolsquareToolmySquareTools
LineToolLineTool SquareToolleftleft right up downSquareToolleftTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolrightTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolupTheLineToolLineEnd2showTheLineToolmyWindowTheLineTooldownTheLineToolLineEnd2showTheLineToolmyWindowTheLineTool
Cancels the connection between attached sprites.
thisSpritethisSprite anotherSprite
Adds 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 mouseScroll
Reports a string without first/all instances of substring.
allall firstthisthisString
Reports a substring of a string.
thisString14
Deletes leading and trailing as parameter defined characters in a string.
..this string...0
Reports the Euclidean distance of to points.
Metric for Strings.
SaturdaySunday
Deletes 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 anotherSprite
Reads 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 anotherSprite
Draws a line on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
thisSpritethisSprite theStage anotherSpritefalseposition1position2
Draws a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
drawdraw fillthisSpritethisSprite theStage anotherSpritefalseposition1position2
Draws or fills a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
drawdraw fill20thisSpritethisSprite theStage anotherSpritefalseposition1
Draws 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 anotherSpritefalseposition1
Reports the width of the text, if drawn on a Sprite.
my text18thisSpritethisSprite theStage anotherSprite
i515025-2402
Returns 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 urlTEXTCSVRGBJSONFITS
Returns 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 FITSTEXTTXTCSVRGBCSVJSONJSONFITSFITSFTS
Returns a list with one or more elements consisting of [filename/BLOB].
filefile filelist
Returns 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)12
Saves the data to a file of the specified type.
SciSnap!DataSciSnap!Data costumeData other RGB dataTEXTTEXT CSV RGB JSONthis fileTEXTCSVRGBJSON
Imports 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!Data100001columnswidthrowsheightFITStruerowscolumns1times1011
Adds a new entry to SciSnap!Messages, shows the error message, and stopps all.
something wrong!thisBlock
Creates 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=edgesShowWeights
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a simple way to set some costume attributes. 1: width 2: height 3: back color
400300thisSpritethisSprite theStage anotherSpriteStagebackColorxLeft0.1xRight0.9yLower0.9yUpper0.1
a 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 shown
3truefalsethisSpritethisSprite theStage anotherSpriteverticesMinRadiusverticesGrowingverticesContentShown
a 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 weight
1falsefalsefalsethisSpritethisSprite theStage anotherSpritelineWidthlineColoredgesDirectededgesWithWeightsedgesShowWeights
adds a vertex at position. Snap!coordinates means: zero is in the middle of the graph
thisSpritethisSprite theStage anotherSpritetrueoffsetsoffsetsposition1xLeft2yUpper1xRight2yLower4vertexList
adds 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)adjacencyMatrixvertexListmyPropertiesnull
Moves a vertex to another position measured in Snap! sprite-coordinates
1thisSpritethisSprite theStage anotherSprite100truevertexList1vertexList12vertexList2
Creates a new edge between two vertices.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexListadjacencyMatrixXadjacencyMatrixXedgesDirected
Creates n new edges randomly.
1thisSpritethisSprite theStage anotherSpriteresultSciS_addRandomEdgesToGraph(amatrix,n,properties,vlist)adjacencyMatrixmyPropertiesvertexListadjacencyMatrix1vertexList2
draws the graph on a GraphPad.
thisSpritethisSprite theStage anotherSpriteinitialCostumeinitialCostumeinitialCostumeinitialCostumeSciS_drawGraphOnGraphPad(amatrix,vlist,properties)adjacencyMatrixvertexListmyPropertiesinitialCostume
Deletes a vertex.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes an edge.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexListadjacencyMatrix0edgesDirected
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
Sets the weight of an edge.
121thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
thisSpritethisSprite theStage anotherSpritefrom vertex nr
Input for start vertex.
thisSpritethisSprite theStage anotherSpritenew start vertexwidth (1....20)
1thisSpritethisSprite theStage anotherSprite0vertexList
Sets the content of a vertex.
1thisSpritethisSprite theStage anotherSprite0vertexList
Input for a new vertex content.
thisSpritethisSprite theStage anotherSpritevertex number
Tells a vertex to be marked.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes a marker.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes all markers.
thisSpritethisSprite theStage anotherSpriteitemvertexList
Depth first search in a graph.
1thisSpritethisSprite theStage anotherSprite0vertexList
Breadth first search in a graph.
1thisSpritethisSprite theStage anotherSprite0vertexList
Reports the Euclidean distance of two vertices.
thisSpritethisSprite theStage anotherSprite120vertexList0vertexList
Shortes path between two vertices, using Dijkstra-method.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
Shortes paths between startVertex and all connected vertices, using Dijkstra-method.
1thisSpritethisSprite theStage anotherSprite0vertexList
Returns the vertexnumber of a vertex near (x|y), if there is one.
thisSpritethisSprite theStage anotherSpritetruepositionoffsetsoffsetsSciS_vertexnumberAtGraph(vlist,properties,position)vertexListmyProperties
Reports the vertexnumber of the vertex with the specified content. If not found then reports 0.
PeterthisSpritethisSprite theStage anotherSpritenr0itemvertexList0
meanmeancolumn2thisSpritetrue12
numberXdiagramSpriteduplicateDiagramSpriteDiagramSprite400300lightGrayfalsetrue15DiagramSpriteEdges per Node18Number of Edges16Number of Vertices166DiagramSpritetrueDiagramSprite
Creates 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 NN
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a simple way to set some costume attributes: 1: width 2: height 3: back color 4: offsets for NN position on stage
400300thisSpritethisSprite theStage anotherSpriteStagenetWidthnetHeightoffsets00backColor
a simple way to set net attributes: 1: number of layers 2: layer width
23thisSpritethisSprite theStage anotherSpritenumberOfLayerslayerWidth
Creates a fully connected neural network of perceptrons. Inputs should be connected to layer 1, outputs to last layer.
23thisSpritethisSprite theStage anotherSpritemyDataone matrix for each layer1myDatanumberOfLayerslayerWidth
Reports the output of the nth layer of a neural network with given input.
last1 lastthisSpritethisSprite theStage anotherSpriteinputinputs0vectorlayerWidth
Draws the nodes and current status of connections of an NN as new costume.
thisSpritethisSprite theStage anotherSpriteinputinputs0layerWidthSciS_NNshowStatus(properties,weights,outputs,costume,isStage)myPropertiesmyDataStage
A block for teaching a neural net.
0.1thisSpritethisSprite theStage anotherSpritewidthlayerWidth
thisSpritethisSprite theStage anotherSprite
Creates 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 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 anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a 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 stage
40030000thisSpritethisSprite theStage anotherSpriteStage
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color 4: fill color
continuouscontinuous dashed dash-dot dot-dot1thisSpritethisSprite theStage anotherSpritelineWidthlineStylelineColorfillColor
a 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 myData
thisSpritethisSprite theStage anotherSprite403011truewhcostumeWidthwscostumeHeight11numberOfGridRowsnumberOfGridColumnscellWidthcellHeightcellHeightwithGridLinesmyDatamyData
Draws a grid on an GridPad.
myDatathisSpritethisSprite theStage anotherSpritemyDatamatrixnumberOfGridColumnsthisSprite1numberOfGridRowsthisSpriteSciS_addGridToGridPad(costume,properties,withLines,data)myPropertieswithGridLines
Fills a grid or a part of a grid with one of the specified values.
thisSpritethisSprite theStage anotherSprite1xMax1yMaxxMaxyMaxmyDataSciS_fillOnGridPadGridRandomlyOnImagePad(xMin,xMax,yMin,yMax,numbers,data)myDatamyData
sets the value of a grid cell
thisSpritethisSprite theStage anotherSprite1targetCostumetargetCostumeWidthtargetCostumeHeightStage11myData
Obtaining data with the mouse from a grid stored in myData.
cellValuecell value=cellValue cell coodinates=cellCoordinates costume coordinates=costumeCoordinatesthisSpritethisSprite theStage anotherSpriteselection1 targetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.cellCoordinatescoordinates of a grid cellcellValuevalue of a grid cell
Sets the value of a grid cell an shows the result.
thisSpritethisSprite theStage anotherSprite112true11numberOfGridColumnsnumberOfGridRows
thisSpritethisSprite theStage anotherSprite1111numberOfGridColumnsnumberOfGridRows
Reports the Moore- or v.-Neumann-neighborhood of a cell. Order: north,east,south,west
MooreMoore vonNeumannfalse11thisSpritethisSprite theStage anotherSpriteSciS_neighborhoodInGridOnImagePad(data,properties,x,y,isTorus,typeOfNeighborhood)myDatamyProperties
Swaps the cell values of a grid randomly.
thisSpritethisSprite theStage anotherSpritetrue111xMax1yMaxxMaxyMax1numberOfGridColumns1numberOfGridRowsSciS_swapCellsOfGridOnGridPad(data,n,isTorus,range,xMin,xMax,yMin,yMax)myData
Counts 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)myData1 1
Replaces 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)myData1
Combines 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-200spriteWidthspriteHeightwindowWidthwindowHeightStage100100
thisSpritethisSprite theStage anotherSpriteJavaScriptJavaScript Snap!positionJavaScript12
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 receiveMessageangle: LineEnd12receiveInteraction mouse-departedisMovingTheLineToolmyWindowTheLineToolLineEnd1receiveInteraction mouse-departedisMovingLineEnd1myWindowTheLineToolLineEnd2receiveInteraction mouse-departedisMovingLineEnd2myWindowTheLineToolTheSquareToolreceiveInteraction scrolleddownTheSquareTool
receiveGoreceiveGo 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 arrowisActive
20theWindow33
20theWindowremoveline15createline15TheLineTool
20theWindownewSpritethisSpriteTheWindow-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 squareTheWindow50
Random graphic, inspired by "Merzbild 1a - the psychiatrist" painted by Kurt Schwitters.
20502050lightGrayStageHilbertoLeft350-250
The 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 costume
Converts a variadic position parameter into a position.
Converts a variadic color parameter into a RGB(A)-value.
41truetrue
Currently not used.
any text
Applies a Wolfram Cellular Automaton to a grid.
3031SciS_applyWolframAutomatonToAgridOnGridPad(no,grid,color0,color1)
Reports whether the set is numerical or not.
this set2
Installs 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.
AZ
Reports a list [p(category1), p(category2), LagrangeSmoothing1, LagrangeSmoothing2, probabilities1, probabilities2) for naive Bayes classification of texts.
pCat1pCat2text11i2text21i2text1text2countedWords110 countedWords210 vocabulary1column1truevocabulary2column1truetotal vocabularylengthTotalVocabularylengthVocabulary1lengthVocabulary2conditional probabilities1valueconditional probabilities2value11
this textresult1factor6result2
12resulti
key,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 anotherSpritespriteNamewhat1 existingSpritesSciS_createObject(operation,sprite,spriteName)itemsomething wrong!create new sprite of sprite
Imports a stored sprite from a file selected with filepicker.
Returns "true" if JavaScript is enabled, else "false".
error
Returns "true" if the key no. n is pressed, else "false".
27
Reports 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.6001172099531121531101215821260360024
Input 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)102018truefalsei1draw2530505false281218truefalsedraw70301005falseok751218truefalseokfalse70100305oktrue0
Allows 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 palette
Allows 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 draggabletrue
Reports 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 ... --> number
Reports the row or column name of the row or column with the number entered, or reports an error message.
columncolumn row1SciSnap!Datatable0columnrow
Evaluates the predicate with a given parameter.
ringified predicate
Evaluates the intervals with a given parameter.
ringified predicateinterval3<false
falseimplies -->implies --> is equivalent to <-->trueis equivalent to <-->ERROR: something went wrong!
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
2resultn1
1141413<232<3<2<4414142<323<2<3<true
3231111111111212121212121212
11resultn1m1n1
11resultn1
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
11define left edge and operator44define right edge and operator
0listOfIntervalsitemfalse
Returns 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)355i132305
Returns all elements of a list not covered by the intervals.
Test wether the predicate is translatable to a list of intervals.
ringified predicate1comparisonOperator1123value32value2false
Intervals should be of structure [leftLimit,operator1,operator2,rightLimit]
interval1interval2intersection0result1144341444341444
determines intervals1 \ intervals2
resultm1n1m1
resultinterval
resultinterval01predicate12i3
2<3<
intervalsi1
Shows the message with headline in the middle of the window.
headlinetheMessage
Reports a vector, built by the items.
Returns a new vector of dimension n with random elements.
3110
Returns a matrix formed from the input vectors.
length1transposed?1column-vectorresultvector
Returns a new nxm-matrix with random elements.
32110i1
Creates the transpose of a vector, matrix, or table.
vector or matrix0
Determines a property of a matrix or vector.
minmin max minpos maxpos number sum mean median variance standard-deviation softmaxmatrix or vectorchoice1 vectordatasoftmaxmedianminmaxnumbersummeanminposposY1maxposposY1variancestandard-deviationstandard-deviationERROR: unknown option!... of matrix or vector
Linear 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 operation
Applies a mapping matrix to an object that is given as a matrix of points.
matrixlist of points
Solves a linear system of max. 50 equations.
matrixcolumn vectorcolumn-vector01bmatrixcreate matrix with attached column bsolvedtrue50columncreate matrix with attached column bdTry to solve matrixr1rowswap rowshelpnormalize row1k11k1k1diagonalizer1
Reports 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 E
Calculates 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 row1k11k1k1diagonaizer1
Calculates the value of a polynomial for input x.
polynomial as list of coefficients11result12i3
Applies 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.
23
Reports a complex number in polar form.
230
Reports a complex number in polar or Cartesian form.
complex numberpolarpolar Cartesian
Reports properties of complex numbers.
real-partabsolute-value real-part imaginary-part phase conjugatecomplex numberreal-partimaginary-partphaseconjugateERROR: unknown operator!... of complex number
Reports arithmetic results of two complex numbers.
z1++ - * /z2complex-numbercomplex-number-polar-formcomplex-number-polar-form+-*/cnC22333223
Creates 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 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 arrows
Reports 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 script
Reports 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-value4truetruetrue
Returns 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 magenta
Reports true if the varname is part of the scope of the sprite. the varname is not used case-sensitive!
varnamethisSpritethisSprite theStage anotherSpritevar_names(scope)sprite
Sets 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 anotherSpritemyProperties
Returns 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 anotherSpritemyProperties
a 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 properties
40030000truefalse15thisSpritethisSprite theStage anotherSpriteoffsetsmyProperties
a 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 arrows
1false3-1010-1010-1010000thisSpritethisSprite theStage anotherSpriteoldDimensionsdimensionsmyPropertiesoldXmaxxMaxmyPropertiesoldXminxMinmyPropertiesoldYmaxyMaxmyPropertiesoldYminyMinmyPropertiesoldZminzMinmyPropertiesoldZmaxzMaxmyPropertiesoldWithGrid?withGrid?myPropertieslineWidthmyPropertiesonlyPointsmyPropertiesdimensionsmyPropertiesxMinmyPropertiesxMaxmyPropertiesyMinmyPropertiesyMaxmyPropertieszMinmyPropertieszMaxmyProperties321withGrid?myPropertiescostumeWidthcostumeHeightbackColor
Draws 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-of
Draws members of a set.
set1blackblack gray lightGray white red orange yellow green cyan blue magenta11thisSpritethisSprite theStage anotherSpritesetdimensionsmyProperties115propertiesmyPropertieswidthwidthheightheightxminxMinxmaxxMaxleftOffset1offsetsupperOffset2offsetsdl305level30x0lineColorlineWidthSciS_MathPadPlotSet(set,setname,properties,atY,costume)myProperties20
Changes the name of a costume.
a costumenew costume nametrue
Adds 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 palette
Sets a local variable of a sprite to the specified value.
varnamethisSpritethisSprite theStage anotherSpriteanyValue
Reports the value of a local variable.
varnamethisSpritethisSprite theStage anotherSpriteERROR: variable don't exist.get ... of sprite
This 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 filepickerJSON
Reports a copy of a costume.
a costume
Reports the costume of a sprite or the stage.
thisSpritethisSprite theStage anotherSpritecostume
Displays a list in a dialog window.
This command closes all open dialog windows in a brutal way. ;-)
error
Catch 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.
0
Selects 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-resize
Test 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-formlistOfIntervalstrueset234listOfIntervals55numericalListresult0falsefalse
Returns a random number between 0 and 1.
Reports Pi.
Reports Euler's number.
The factorial function.
Reports a binomial coefficient.
531result1n1i1
Rounds value x to n digits.
1.23572
Reports a string with replacement instead of substring.
allall firstthisthatthisString
Reports the index of first appearance of substring in string.
ringthisString
Returns a root of an equation calculated with Newton's method.
ringified term1epsilon0.00001i11000
Reports an element of a sequence.
ringified term1
Returns a list of the first n elements of a sequence.
1ringified term1
Returns a list of secant slopes calculated with the given sequence.
ringified term21/n1/nelement
Reports the secant slope "nearby" the given point.
ringified term1epsilon0.00001
Returns a finite sum.
10ringified term0result0i
Returns the integral of a term calculated with n trapezoids.
2ringified term11000dxx11
Reports either - data Fourier transformed to frequency-space - "raw" FFT (Fast Forier Transformation) data formatted as SciSnap! complex numbers - or iFFT real data
frequency_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.
132
Reports coefficient of the normal distribution.
101
The 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>.
230
Creation 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≤ <≤ <InfinityInfinitysettrue
Creation 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 predicatepredicateTree
Reports whether "element" is element of "set".
elementsetset
Reports the intersection, union, difference, or cross product of two sets.
set1∩ ∪ \ Xset2are these two sets?set4044455555\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.Xset2233
Is set1 subset of set2?
set1set2are these two sets?set555intervalelement3Compare elementstrue
Are theses two sets equal?
set1set2set
Reports up to n elements of a set. Numers are natural numbers smaller than maxSetValue in SciSnap!-properties.
10setresult3405i1maxSetValue should be close to infinity ;-)resultvalueindexlistclean up1
Reports the enumerated elements and numbers written as intervals of the set.
elementselements intervals predicatethis setelementsintervalspredicatetrue
Returns the value of the left or right edge of an interval.
leftleft right
Reports simple types, sets and lists as string.
5i1maxSetValue should be close to infinity ;-)elementsvalueindexlist20item18is first elementtrueitem18ERROR: no simple type!elements --> text
Converts a string to a list of elements.
1,2,[3,4],{6,7,8..12}]10]0]0}10}0}0find lists
Returns an empty table.
Reports the copy of a list or an empty list.
table or list
Type conversions
table or listCSVDATAASTEXT CSV JSON
Reports a new table initialized with value.
23a valueresult
Reports a table with labeled columns.
23i1rowERROR: labels required!new ... table with labels
Reports randomly distributed points in the form of a rectangle, circle, or ring.
100-100100-100100squaresquare circle ringcirclering
Creates new random data in the specified ranges swaying by a straight.
10-55102
Generates a list of points "near" a given graph.
20-552
Reports 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!Datatruechoice1 tablerowlast1columnlast11ERROR: something wrong!row/column of data
Adds a row, a column, or column headers to a table.
rowrow column column-headersa listSciSnap!Datachoice1 tablerowi1column0i1column-headersi11
Deletes 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!Datatablerowlastcolumnlast11item
Reports the element a position x|y of a table, identified by numbers or names.
numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001
Replaces the value at position x|y of a table.
numberOrNamenumberOrNameSciSnap!Datatablexcolumnyrow001
Reports 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-from
counts the appearances of the values of a list or table.
a table or list
Reports a sorted list.
a list
returns the entropy of a list of data
a table or list
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!Datatable
Normalizes a table by dividing it by the specified value.
SciSnap!Datameanmean max number sum median softmaxchoice1 vector0
Reports a vector or matrix with compressed columnsonly columns .
SciSnap!Data2isMatrixmatrixvector11resulti11iresultcolumnNr11
Pooling operation with matrices, images and vectors. On the top of the result are the new dimensions.
maxmax meanSciSnap!Data21typeOfPooling1 matrixvectorFITSRGBmatrixFITSRGBSciS_pooling(data,width,height,typeOfPooling,stride,typeOfData)
Sorts a list or table.
SciSnap!DatanumberOrNametruetrueisTabletable1result1
Determines a group of properties of a table.
meanmin max number sum meannumberOrNameSciSnap!DatanumberOrNametruetablegroupcolumncolumn11valuecolumncolumn11choice1 copytrue0SciS_groupeddata(aTable,compaircolumn,operation,groupcolumn)
Calculates the ranges, the covariance or the correlation between two columns of a table.
rangesranges covariance correlationnumberOrNamenumberOrNameSciSnap!Datatruetablencolumn11mcolumn11copychoice1 1SciS_propertiesoftable(selection,table,x,y)1
Calculates the parameters of a regression line.
SciSnap!DatamatrixsumX0sumY0numerator0denominator0dummymeanXmeanYdummymb
Determines 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-data114
Applies 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 centers
labels of data: -1 not visited, 0 visited, -2 noise, >0 clusternr
SciSnap!Data505matrix2SciS_DBSCAN(data,r,minMembers)-1
reports an ID3 decision tree constructed on the base of labeled data
SciSnap!Datatablewrong data0empty datasetSciS_ID3Tree(data)
returns the class of a dataset using an ID3-decision-tree
datathis 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 border
Reports whether the sprite is configured as a PlotPad.
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a 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 anotherSpriteStage
Sets the labels and textheights of the diagrams of a PlotPad and redraws them.
thisSpritethisSprite theStage anotherSpriteDiagram Title18x-label16y-label16titlexLabelyLabeltitleHeightxLabelHeightyLabelHeight
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color red 4: line color green 5: lineColor blue
continuouscontinuous dashed dash-dot dot-dot rainbow inverse-rainbow1thisSpritethisSprite theStage anotherSpritelineStylelineWidthlineColor
a 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 blue
squarenone o_circle ._point +_plus x_ex square triangle5falsethisSpritethisSprite theStage anotherSpritemarkerStylemarkerWidthmarkerConnectedmarkerColor
Sets some properties for scales and redraws them.
2212121010thisSpritethisSprite theStage anotherSpritefalsescalesXprecisionscalesYprecisionscalesXtextheightscalesYtextheightscalesXintervalsscalesYintervalsscalesXstartxLeftscalesXstepxRightxLeftscalesXintervalsscalesXscaling1scalesXminitics1scalesYstartyLowerscalesYstepyUpperyLowerscalesYintervalsscalesYscaling1scalesYminitics1
Sets the distances of the diagram axes to the edges of the Sketchpad.
thisSpritethisSprite theStage anotherSpriteupperOffset1scalesXtextheighttitle0scalesTiclength0lowerOffset1scalesXtextheightscalesYcenteredrightOffset1.5scalesYtextheightscalesTiclength0leftOffset1scalesYtextheightscalesXcenteredscalesTiclength0scaleLeftOffsetscaleRightOffsetscaleUpperOffsetscaleLowerOffset
Sets the ranges for the axes of the diagrams of a PlotPad and redraws it..
-1010-1010false0.1thisSpritethisSprite theStage anotherSpritepretty
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws 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)myPropertiesoldPlotsplotsisNewtrueentry
Draws a histogram of histogram data.With a lot of additions by Rick Hessman. Thanks!
myData10thisSpritethisSprite theStage anotherSpritetruemyDatavector0costumestart0transposed-vectorminmaxdeltah2resulti1221i1histgramData0prettySciS_addHistogramToPlotpad(costume,properties,data)myPropertiesoldPlotsplotsisNewtrueentry
Draws and labels the axes of a PlotPad. With lot of additions of Rick Hessman. Thanks!
thisSpritethisSprite theStage anotherSprite
Clears the plot area of a PlotPad.
plotAreaplotArea plotData costumethisSpritethisSprite theStage anotherSpriteoldFillColorfillColorfillColorbackColorplotAreacostumeplotDatafillColor
Restores the last plotson the PlotPad.
thisSpritethisSprite theStage anotherSpriteplotplots1numericData1mixedData1histogram
Sets 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).scalingintervalsprecisionminitics
thisSpritethisSprite theStage anotherSpritemyData0.1myData2dy43xLeft1xRight2yLower3yUpper4scalesXstart1scalesXstep21scalesXintervalsscalesXscaling1scalesXminitics1scalesYstart3scalesYstep43scalesYintervalsscalesYscaling1scalesYminitics1
Calculates the ranges of two columns of a table.
Conversion of coordinates.
100xpxp yp x ythisSpritethisSprite theStage anotherSpritediagramWidthscaleLeftOffsetdiagramHeightscaleLowerOffsetscaleUpperOffsetx0xLeftxLeftxRighty0yUpperyUpperyLowercoordinate1 xpypxy
Obtaining coordinates of a PlotPad at mouseposition.
costume-coordinatescostume-coordinates graph-coordinatesthisSpritethisSprite theStage anotherSpriteselection1 targetCostumetargetCostumeWidthtargetCostumeHeighttargetXPositiontargetYPositiontargetSizecostume-coordinatescostume coordinates.graph-coordinatescostume coordinates.
400300continuouso_circle0
400300continuous
00600400continuousnone continuous dashed dash-dot dot-dot rainbow inverse rainbowsquarenone o_circle ._point +_plus x_ex square triangle0thisSprite0.07thisSpritethisSprite18161615thisSpritethisSprite
Changes the spritename.
thisSpritethisSprite anotherSpritenew nameSciS_changeSpritenameTo(sprite,newName)
Reports a list of sprites with similar names. Used when "cleaning up".
thisName
Checks whether an element is anywhere in a list.
this value
Creates 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=connect12ok0115ERROR
Reports a list of databases on the server and sets the corresponding properties.
databasesconnection&type=getDBs000115ERROR
Selects one of the databases and sets the corresponding properties.
2databasescurrentDatabasedatabasesdummyconnection&command=USE currentDatabasetablestablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERROR
Reports a list of tables of the chosen database and sets the corresponding properties.
tablesconnection&command=SHOW TABLES FROM currentDatabase&type=getTables000115ERROR
Selects one of the tables and sets the corresponding properties.
1tables0115ERROR
Reads the attributes of the specified table and sets the corresponding properties.
1tables0115ERROR
Generates a simplified SQL query.
* DISTINCTi11result FROM 0result2
Generates an almost complete SQL query.
* DISTINCTASCASC DESC10i11result FROM 0result20result20resultASC
Executes an SQL query.
1:ERRORreplaces "%" with "%25" to prevent trouble with the url-block.resultconnection&type=query&query=&database=currentDatabase
Imports the results of an SQL-query to SQLData and sets the corresponding properties.
typeOfDatatable0minValuenot setmaxValuenot set
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 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.
10anything
Inspired by Jackson Pollock ;-)
StageStage220200225
Creates 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 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 anotherSprite
Reads 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 anotherSpritemyProperties
Sets 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 anotherSpritemyProperties
a 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 stage
40030000thisSpritethisSprite theStage anotherSpriteStage
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color 4: fill color
continuouscontinuous dashed dash-dot dot-dot1thisSpritethisSprite theStage anotherSpritelineWidthlineStylelineColorfillColor
if 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 data
Generates, 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 theStagetypeOfDataFITStypeOfDataRGBmyDatacolor1 selection1 RGBtypeOfDataRGBcreateoffsetstheStageStageimageWidththeStage2StageimageHeighttheStage2offsets00costumeWidthcostumeHeightSciS_addImageToImagePad(data,properties,color,log,alpha,pixels,selection)myDatamyPropertiesStage
Draws a list of "points" in different "shapes".
myDatacirclescircles squares5thisSpritethisSprite theStage anotherSpritefalsefalse20sourcemyDatamatrix012source121lastvalueSciS_drawListOfPoints(costume,data,shape,size,properties,withNoise,range)myProperties
Sets the RGB or image data value at (x|y) on costume or myData of target.
RGBRGB image data in myDatathisSpritethisSprite theStage anotherSpritean appropriate valuefalsepositionx1y2vectorRGB34vectorlineColor1thisSpritefalsetrue
Reports the RGB value at the position (x|y) of the costume.
RGB(A)RGB(A) image data of myData =imageDatathisSpritethisSprite theStage anotherSpritefalsepositionx1y2costumeWidthcostumeHeight11RGB(A)typeOfDataRGBtypeOfDataFITS
Obtaining 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 anotherSpritefalseselection1 isDraggabletargetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.imageValueimage value.11RGBvalueRGB value.11lineDataokfalseokfalsexold1yold2Stagedraggableline datacostumeSlicedataSliceslice datacircleDatacircle dataokfalseokfalseStagebrightnessbrightnessERROR: unknown selectionimageValue/... on ... by mouse
Applies 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)typeOfDatacircle
Removes the calling sprite.
thisSpritethisSprite anotherSpriteSciS_removeSprite(sprite)
Selects a sprite as active.
thisSpritethisSprite theStage anotherSprite
This 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 clicked
Arthmetic 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!
valuediagram
An image of Albategnius should be loaded as costume of the sprite!
t0a0.1225positionStagecircles2theStagetruetrue100t1
Creates an Infobox about this category.
thisSpritethisSprite theStage anotherSpriteanotherSpriteanotherSprite theStage thisSprite1Stage size2Stage sizemyImagescurrentImagemyLineToolnot setmySquareToolscostumeWidthcostumeHeight
thisSpritethisSprite theStage anotherSprite
addadd removethisSpritethisSprite theStage anotherSpritetrue
nextnext first last any number = numberthisSpritethisSprite theStage anotherSpritetruemyImages1myImages0myImagesmyImageslightGraycurrentImagelightGray
thisSpritethisSprite theStage anotherSpritelightGraycurrentImage
thisSpritethisSprite theStage anotherSprite25currentImagenew sizecurrentImage5currentImage
thisSpritethisSprite theStage anotherSprite1010currentImageimagecurrentImage
thisSpritethisSprite theStage anotherSpritecurrentImageisDraggableoldMouseXoldMouseY
Stage 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 anotherSpritefalseselection1 window-positionimage-positionimageSizecurrentImage100NaNimageOffsetscurrentImageStageStagecurrentImageresult1currentImageStage2StagecurrentImage
thisSpritethisSprite theStage anotherSpriteposition1122
Checks whether the specified sprite is in the list of deleted sprites.
thisSpritethisSprite anotherSpriteallTheSpriteserror
Attaches a sprite as part of another sprite.
a partthisSpritethisSprite anotherSprite
Initialization of SciSnap!
800600EmptyHilbertoRight00
Creates a text-file "SciSnap!Costumes" from present costumes.
data""itemTEXTSciSnap!CostumesSciSnap!Costumes
Creates and stores different SciSnap! costumes.
ready!1
Creates 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 maxSetValue
Sets the value of an existing property or inserts it anew.
typeOfDatatypeOfData width height minValue maxValue columns rows maxSetValue
Returns the value of an existing global SciSnap!-property or "". Items: typeOfData width height minValue maxValue columns rows maxSetValue
minValuetypeOfData width height minValue maxValue columns rows maxSetValue
Creates 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: closeButtonSize
Test on different SketchPad types.
thisSpritethisSprite theStage anotherSpriteSketchPadSketchPad MathPad PlotPad ImagePad GraphPad NNPad GridPadmyPropertiesfalse
Reshapes and cleares the costume of a SketchPad.
thisSpritethisSprite theStage anotherSprite400300SketchPadcostumeWidthmyPropertiescostumeHeightmyPropertiesoffsetsmyProperties22fillColorthisSpritebackColortheStagedrawStage2Stage2Stage2Stage2theStagefalsefillStage2Stage2Stage2Stage2theStagefalse
Deletes a SketchPad.
thisSpritethisSprite anotherSprite
If necessary, place the close button in the correct position.
thisSpritethisSprite anotherSpriteSketchPadmyCloseButtonnot setwithCloseButtontypeOfConfigurationSketchPadmyPropertieslineWidth1myPropertieslineStylecontinuousmyPropertieslineColor000myPropertiesdraw00false00false00false12222myCloseButton
This 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-positiontruefalseLineEnd2TheLineToolTheSquareTooltoolTheSquareToolshow
Moves tools to new positions corresponding to their image coordinates.
thisSpritethisSprite theStage anotherSpriteTheLineToolLineEnd2TheLineToolshowTheLineToolTheSquareTool
thisSpritethisSprite theStage anotherSpriteTheLineToolsquareToolmySquareTools
LineToolLineTool SquareToolleftleft right up downSquareToolleftTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolrightTheLineToolLineEnd2showTheLineToolmyWindowTheLineToolupTheLineToolLineEnd2showTheLineToolmyWindowTheLineTooldownTheLineToolLineEnd2showTheLineToolmyWindowTheLineTool
Cancels the connection between attached sprites.
thisSpritethisSprite anotherSprite
Adds 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 mouseScroll
Reports a string without first/all instances of substring.
allall firstthisthisString
Reports a substring of a string.
thisString14
Deletes leading and trailing as parameter defined characters in a string.
..this string...0
Reports the Euclidean distance of to points.
Metric for Strings.
SaturdaySunday
Deletes 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 anotherSprite
Reads 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 anotherSprite
Draws a line on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
thisSpritethisSprite theStage anotherSpritefalseposition1position2
Draws a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
drawdraw fillthisSpritethisSprite theStage anotherSpritefalseposition1position2
Draws or fills a rectangle on present costume using line properties. Coordinates can be used as Snap! or JS coordinates.
drawdraw fill20thisSpritethisSprite theStage anotherSpritefalseposition1
Draws 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 anotherSpritefalseposition1
Reports the width of the text, if drawn on a Sprite.
my text18thisSpritethisSprite theStage anotherSprite
i515025-2402
Returns 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 urlTEXTCSVRGBJSONFITS
Returns 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 FITSTEXTTXTCSVRGBCSVJSONJSONFITSFITSFTS
Returns a list with one or more elements consisting of [filename/BLOB].
filefile filelist
Returns 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)12
Saves the data to a file of the specified type.
SciSnap!DataSciSnap!Data costumeData other RGB dataTEXTTEXT CSV RGB JSONthis fileTEXTCSVRGBJSON
Imports 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!Data100001columnswidthrowsheightFITStruerowscolumns1times1011
Adds a new entry to SciSnap!Messages, shows the error message, and stopps all.
something wrong!thisBlock
Creates 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=edgesShowWeights
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a simple way to set some costume attributes. 1: width 2: height 3: back color
400300thisSpritethisSprite theStage anotherSpriteStagebackColorxLeft0.1xRight0.9yLower0.9yUpper0.1
a 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 shown
3truefalsethisSpritethisSprite theStage anotherSpriteverticesMinRadiusverticesGrowingverticesContentShown
a 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 weight
1falsefalsefalsethisSpritethisSprite theStage anotherSpritelineWidthlineColoredgesDirectededgesWithWeightsedgesShowWeights
adds a vertex at position. Snap!coordinates means: zero is in the middle of the graph
thisSpritethisSprite theStage anotherSpritetrueoffsetsoffsetsposition1xLeft2yUpper1xRight2yLower4vertexList
adds 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)adjacencyMatrixvertexListmyPropertiesnull
Moves a vertex to another position measured in Snap! sprite-coordinates
1thisSpritethisSprite theStage anotherSprite100truevertexList1vertexList12vertexList2
Creates a new edge between two vertices.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexListadjacencyMatrixXadjacencyMatrixXedgesDirected
Creates n new edges randomly.
1thisSpritethisSprite theStage anotherSpriteresultSciS_addRandomEdgesToGraph(amatrix,n,properties,vlist)adjacencyMatrixmyPropertiesvertexListadjacencyMatrix1vertexList2
draws the graph on a GraphPad.
thisSpritethisSprite theStage anotherSpriteinitialCostumeinitialCostumeinitialCostumeinitialCostumeSciS_drawGraphOnGraphPad(amatrix,vlist,properties)adjacencyMatrixvertexListmyPropertiesinitialCostume
Deletes a vertex.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes an edge.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexListadjacencyMatrix0edgesDirected
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
Sets the weight of an edge.
121thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
thisSpritethisSprite theStage anotherSpritefrom vertex nr
Input for start vertex.
thisSpritethisSprite theStage anotherSpritenew start vertexwidth (1....20)
1thisSpritethisSprite theStage anotherSprite0vertexList
Sets the content of a vertex.
1thisSpritethisSprite theStage anotherSprite0vertexList
Input for a new vertex content.
thisSpritethisSprite theStage anotherSpritevertex number
Tells a vertex to be marked.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes a marker.
1thisSpritethisSprite theStage anotherSprite0vertexList
Deletes all markers.
thisSpritethisSprite theStage anotherSpriteitemvertexList
Depth first search in a graph.
1thisSpritethisSprite theStage anotherSprite0vertexList
Breadth first search in a graph.
1thisSpritethisSprite theStage anotherSprite0vertexList
Reports the Euclidean distance of two vertices.
thisSpritethisSprite theStage anotherSprite120vertexList0vertexList
Shortes path between two vertices, using Dijkstra-method.
12thisSpritethisSprite theStage anotherSprite0vertexList0vertexList
Shortes paths between startVertex and all connected vertices, using Dijkstra-method.
1thisSpritethisSprite theStage anotherSprite0vertexList
Returns the vertexnumber of a vertex near (x|y), if there is one.
thisSpritethisSprite theStage anotherSpritetruepositionoffsetsoffsetsSciS_vertexnumberAtGraph(vlist,properties,position)vertexListmyProperties
Reports the vertexnumber of the vertex with the specified content. If not found then reports 0.
PeterthisSpritethisSprite theStage anotherSpritenr0itemvertexList0
meanmeancolumn2thisSpritetrue12
numberXdiagramSpriteduplicateDiagramSpriteDiagramSprite400300lightGrayfalsetrue15DiagramSpriteEdges per Node18Number of Edges16Number of Vertices166DiagramSpritetrueDiagramSprite
Creates 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 NN
thisSpritethisSprite theStage anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a simple way to set some costume attributes: 1: width 2: height 3: back color 4: offsets for NN position on stage
400300thisSpritethisSprite theStage anotherSpriteStagenetWidthnetHeightoffsets00backColor
a simple way to set net attributes: 1: number of layers 2: layer width
23thisSpritethisSprite theStage anotherSpritenumberOfLayerslayerWidth
Creates a fully connected neural network of perceptrons. Inputs should be connected to layer 1, outputs to last layer.
23thisSpritethisSprite theStage anotherSpritemyDataone matrix for each layer1myDatanumberOfLayerslayerWidth
Reports the output of the nth layer of a neural network with given input.
last1 lastthisSpritethisSprite theStage anotherSpriteinputinputs0vectorlayerWidth
Draws the nodes and current status of connections of an NN as new costume.
thisSpritethisSprite theStage anotherSpriteinputinputs0layerWidthSciS_NNshowStatus(properties,weights,outputs,costume,isStage)myPropertiesmyDataStage
A block for teaching a neural net.
0.1thisSpritethisSprite theStage anotherSpritewidthlayerWidth
thisSpritethisSprite theStage anotherSprite
Creates 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 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 anotherSprite
Sets 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 anotherSpritemyProperties
Reads 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 anotherSpritemyProperties
a 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 stage
40030000thisSpritethisSprite theStage anotherSpriteStage
a simple way to set some net attributes: line properties: 1: line style 2: lineWidth 3: line color 4: fill color
continuouscontinuous dashed dash-dot dot-dot1thisSpritethisSprite theStage anotherSpritelineWidthlineStylelineColorfillColor
a 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 myData
thisSpritethisSprite theStage anotherSprite403011truewhcostumeWidthwscostumeHeight11numberOfGridRowsnumberOfGridColumnscellWidthcellHeightcellHeightwithGridLinesmyDatamyData
Draws a grid on an GridPad.
myDatathisSpritethisSprite theStage anotherSpritemyDatamatrixnumberOfGridColumnsthisSprite1numberOfGridRowsthisSpriteSciS_addGridToGridPad(costume,properties,withLines,data)myPropertieswithGridLines
Fills a grid or a part of a grid with one of the specified values.
thisSpritethisSprite theStage anotherSprite1xMax1yMaxxMaxyMaxmyDataSciS_fillOnGridPadGridRandomlyOnImagePad(xMin,xMax,yMin,yMax,numbers,data)myDatamyData
sets the value of a grid cell
thisSpritethisSprite theStage anotherSprite1targetCostumetargetCostumeWidthtargetCostumeHeightStage11myData
Obtaining data with the mouse from a grid stored in myData.
cellValuecell value=cellValue cell coodinates=cellCoordinates costume coordinates=costumeCoordinatesthisSpritethisSprite theStage anotherSpriteselection1 targetCostumetargetCostumeWidthtargetCostumeHeightStagecostumeCoordinatescostume coordinates.cellCoordinatescoordinates of a grid cellcellValuevalue of a grid cell
Sets the value of a grid cell an shows the result.
thisSpritethisSprite theStage anotherSprite112true11numberOfGridColumnsnumberOfGridRows
thisSpritethisSprite theStage anotherSprite1111numberOfGridColumnsnumberOfGridRows
Reports the Moore- or v.-Neumann-neighborhood of a cell. Order: north,east,south,west
MooreMoore vonNeumannfalse11thisSpritethisSprite theStage anotherSpriteSciS_neighborhoodInGridOnImagePad(data,properties,x,y,isTorus,typeOfNeighborhood)myDatamyProperties
Swaps the cell values of a grid randomly.
thisSpritethisSprite theStage anotherSpritetrue111xMax1yMaxxMaxyMax1numberOfGridColumns1numberOfGridRowsSciS_swapCellsOfGridOnGridPad(data,n,isTorus,range,xMin,xMax,yMin,yMax)myData
Counts 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)myData1 1
Replaces 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)myData1
Combines 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-200spriteWidthspriteHeightwindowWidthwindowHeightStage100100
thisSpritethisSprite theStage anotherSpriteJavaScriptJavaScript Snap!positionJavaScript12
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 receiveMessageangle: LineEnd12receiveInteraction mouse-departedisMovingTheLineToolmyWindowTheLineToolLineEnd1receiveInteraction mouse-departedisMovingLineEnd1myWindowTheLineToolLineEnd2receiveInteraction mouse-departedisMovingLineEnd2myWindowTheLineToolTheSquareToolreceiveInteraction scrolleddownTheSquareTool
receiveGoreceiveGo 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 arrowisActive
20theWindow33
20theWindowremoveline15createline15TheLineTool
20theWindownewSpritethisSpriteTheWindow-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 squareTheWindow50
Random graphic, inspired by "Merzbild 1a - the psychiatrist" painted by Kurt Schwitters.
20502050lightGrayStageHilbertoLeft350-250
The 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 costume
Converts a variadic position parameter into a position.
Converts a variadic color parameter into a RGB(A)-value.
41truetrue
Currently not used.
any text
Applies a Wolfram Cellular Automaton to a grid.
3031SciS_applyWolframAutomatonToAgridOnGridPad(no,grid,color0,color1)
Reports whether the set is numerical or not.
this set2
Installs 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.
AZ
Reports a list [p(category1), p(category2), LagrangeSmoothing1, LagrangeSmoothing2, probabilities1, probabilities2) for naive Bayes classification of texts.
pCat1pCat2text11i2text21i2text1text2countedWords110 countedWords210 vocabulary1column1truevocabulary2column1truetotal vocabularylengthTotalVocabularylengthVocabulary1lengthVocabulary2conditional probabilities1valueconditional probabilities2value11
this textresult1factor6result2
12resulti
§_dynamicMenucat
You 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 blockscat
hidehide show
A simple example for a SciSnap!-configuration: some categories are removed and some blocks are hidden.
hidehidehidehidehide
key,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