This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static-function: function[ /local static-var][ | |
static-var: [] | |
; initialization | |
if empty? static-var [ | |
append static-var 0 | |
] | |
; cum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
??: func [ | |
"Prints a word and the value it refers to (molded)" | |
'value [word! path! string!] | |
/start | |
/local cum | |
][ | |
cum: [] | |
; initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context [ | |
counter: 0 | |
set '?? func ['value /reset][ | |
if reset [counter: 0] | |
counter: counter + 1 | |
print rejoin [ | |
"[" counter "]" tab value ":" space | |
mold get/any value | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> foreach i range 5 10 [print i] | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
>> foreach i range/step 10 5 2 [print i] | |
10 | |
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 2017-12-16 | |
Needs: %range.red | |
Needs-Gist: https://gist.github.com/toomasv/0e3244375afbedce89b3719c8be7eac0 | |
] | |
do %range.red | |
context [ | |
md: make font! [name: "Consolas" size: 12 color: black] | |
ft: make font! [name: "Tahoma" size: 36 color: black];;Lucida Sans Unicode;Unifont;EversonMono |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quotes: {[{"date":1405699200,"high":0.0045388,"low":0.00403001,"open":0.00404545,"close":0.00435873,"volume":44.34555992,"quoteVolume":10311.88079097,"weightedAverage":0.00430043},{"date":1405713600,"high":0.00435,"low":0.00412,"open":0.00428012,"close":0.00412,"volume":19.12271662,"quoteVolume":4531.85801066,"weightedAverage":0.00421961}]} | |
replace/all quotes "[" "" | |
replace/all quotes "]" "" | |
quotes2: split quotes "," | |
;-> [{^{"date":1405699200} {"high":0.0045388} {"low":0.00403001} {"open":0.00404545} {"close":0.00435873} {"volume":44.34555992} {"quoteVolume":10311.88079097} {"weightedAverage":0.00430043^}} {^{"date":1405713600} {"high":0.00435} {"low":0.00412} {"open":0.00428012} {"close":0.00412} {"volume":19.12271662} {"quoteVolume":4531.85801066} {"weightedAverage":0.00421961^}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Title: "For debug" | |
] | |
__DEBUG_LINE_COUNTER__: 0 | |
??: func [ | |
"Prints a word and the value it refers to (molded)" | |
'value [word! path! string!] | |
/start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Title: "Base58 hexa" | |
Uses: https://gist.github.com/lepinekong/4fd51a2897b81f81d1257d5f694bdc7a | |
Description: { | |
This implementation deals with division in hexadecimal | |
as Red doesn't currently support Big Integer. For example: | |
to-integer #{48656C6C6F} ; -> 1214606444 BUG | |
should have been 310939249775 https://www.binaryhexconverter.com/hex-to-decimal-converter | |
to-binary 310939249775 -> #{4252195B1B1BC000} BUG | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json/decode read https://poloniex.com/public?command=returnChartData¤cyPair=BTC_XMR&end=9999999999&period=14400&start=1405699200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table: {Bitcoin | BTC | Digital gold | |
Ethereum | ETH | Programmable contracts and money | |
Bitcoin Cash | BCH | Bitcoin clone | |
Ripple | XRP | Enterprise payment settlement network | |
Litecoin | LTC | Faster Bitcoin | |
Dash | DASH | Privacy-focused Bitcoin clone | |
NEO | NEO | Chinese-market Ethereum | |
NEM | XEM | Batteries-included digital assets | |
Monero | XMR | Private digital cash | |
Ethereum Classic| ETC | Ethereum clone |