Rebol3 Code Examples

A collection of programming tasks implemented in Rebol

1100 doorsControl flow 2100 prisonersGames 321 gameGames 424 gameGames 59 billion names of God the integerMath 6Abbreviations, automaticString 7Abbreviations, easyString 8Abbreviations, simpleString 9ABC correlationMath 10ABC problemMisc 11ABC wordsString 12Abelian sandpile model/IdentityMath 13Abundant odd numbersMath 14Achilles numbersMath 15Additive primesMath 16Almost primeMath 17Alternade wordsString 18AmbControl flow 19AnadromesString 20Anagram generatorString 21AnagramsString 22Anagrams/Deranged anagramsString 23Angle difference between two bearingsMath 24Angles (geometric), normalization and conversionMath 25Anti-primesMath 26Append numbers at same position in stringsString 27Archimedean spiralGraphics 28Arithmetic evaluationMath 29Attractive numbersMath 30Audio alarmI/O 31Audio frequency generatorI/O 32Audio overlap loopI/O 33Autogram checkerString 34Babylonian spiralGraphics 35Bacon cipherCrypto / encoding 36Balanced bracketsString 37Barnsley FernGraphics 38Bell numbersMath 39Best shuffleData structures 40Bifid cipherCrypto / encoding 41Bilinear interpolationGraphics 42Bioinformatics/Sequence mutationMisc 43BiorhythmsMath 44Bitcoin address validationCrypto / encoding 45Bitmap/Flood fillGraphics 46Bitmap/HistogramGraphics 47Bitmap/Midpoint circle algorithmGraphics 48Bitmap/Read a PPM fileI/O 49Bitmap/Write a PPM fileI/O 50Bitwise IOI/O 51Bitwise operationsMath 52BoidsGraphics 53Box the compassMisc 54Brazilian numbersMath 55Brownian treeGraphics 56Bulls and cowsGames 57Bulls and cows playerGames 58Burrows–Wheeler transformCrypto / encoding 59Caesar cipherCrypto / encoding 60Calendar - for "REAL" programmersMisc 61Call an object methodControl flow 62Camel case and snake caseString 63Card shufflesGames 64Case-sensitivity of identifiersnone 65Catalan numbersMath 66Catalan numbers/Pascal's triangleMath 67Changeable wordsString 68Chinese remainder theoremMath 69Chinese zodiacMisc 70Color quantization (Median cut)Graphics 71Color quantization (Octree)Graphics 72Color wheelGraphics 73Command-line argumentsnone 74Compare length of two stringsString 75Conway's Game of LifeGames 76Count in octalMath 77Count the coins/0-1Math 78Create a two-dimensional array at runtimeData structures 79Create an HTML tableString 80CSV data manipulationI/O 81CSV to HTML translationI/O 82CurrencyMath 83CUSIPMath 84Damm algorithmMath 85Deal cards for FreeCellGames 86Death StarGraphics 87DeepcopyControl flow 88Digit fifth powersMath 89Digital rootMath 90Dijkstra's algorithmMath 91Discordian datenone 92Display a linear combinationMath 93DNS queryI/O 94Doomsday ruleMisc 95Dragon curveGraphics 96Draw a clock (CLI)Graphics 97Draw a cuboidGraphics 98Draw a pixelGraphics 99Draw a sphereGraphics 100Draw a torusGraphics 101Element-wise operationsMath 102EntropyMath 103Ethiopian multiplicationMath 104Euclidean rhythmMisc 105Euler methodMath 106Euler's constant 0.5772...Math 107Evolutionary algorithmMisc 108Exactly three adjacent 3 in listsData structures 109Execute Brain****Misc 110Extend your languageMisc 111Extensible prime generatorMath 112FASTA formatI/O 113Fibonacci sequenceMath 114File extension is in extensions listString 115File modification timeI/O 116Find common directory pathString 117Find first missing positiveData structures 118Find limit of recursionControl flow 119Find prime n such that reversed n is also primeMath 120Find unimplemented tasksMisc 121Find words with alternating vowels and consonantsenone 122First-class functions/Use numbers analogouslyControl flow 123Five weekendsMisc 124Flipping bits gamenone 125Floyd's trianglenone 126Forest fireGraphics 127Four is magicMisc 128Fractal treeGraphics 129Fraction reductionMath 130FractranMath 131Gamma functionMath 132Gapful numbersMath 133Generate lower case ASCII alphabetString 134Generate random numbers without repeating a valueData structures 135Get system command outputI/O 136Go FishGames 137Gosper's hackMisc 138Gray codeMath 139Grayscale imageGraphics 140GreedGames 141GSTrans string conversionString 142Happy numbersMath 143Harriss SpiralGraphics 144Hash joinData structures 145Hello world/Standard errorI/O 146Hello world/Web servernone 147Here documentString 148Heronian trianglesMath 149Hex dumpData structures 150Huffman codingCrypto / encoding 151I before E except after CString 152IBANMath 153Image noiseGraphics 154Include a fileControl flow 155Increment loop index within loop bodyControl flow 156InfinityMath 157Integer overflowMath 158Integer sequenceMath 159IntrospectionControl flow 160Inverted indexData structures 161ISBN13 check digitMath 162Jacobsthal numbersMath 163JSON pointerString 164Julia setGraphics 165Knapsack problem/0-1Math 166Knapsack problem/BoundedMath 167Knapsack problem/ContinuousMath 168Knapsack problem/UnboundedMath 169Knight's tourGames 170Knuth shuffleData structures 171Kronecker productMath 172Kronecker product based fractalsMath 173Largest number divisible by its digitsMath 174Leap yearMisc 175Legendre prime counting functionMath 176Letter frequencyString 177Levenshtein distanceString 178Long multiplicationMath 179Long yearMath 180Longest common suffixString 181Longest string challengeString 182Look-and-say sequenceMath 183Loops/With multiple rangesControl flow 184Loops/Wrong rangesControl flow 185Ludic numbersMath 186Luhn test of credit card numbersMath 187Lychrel numbersMath 188Lyndon wordString 189LZW compressionCrypto / encoding 190Mandelbrot setGraphics 191Markov chain text generatorString 192Mayan numeralsMisc 193Maze generationGraphics 194MD4Crypto / encoding 195Memory allocationMisc 196Minimum numbers of three listsData structures 197Minimum primesMath 198Morse codeCrypto / encoding 199MultitonMisc 200Munching squaresGraphics 201Möbius functionMath 202N'thString 203Named parametersMisc 204Naming conventionsMisc 205Natural sortingData structures 206Nautical bellMisc 207Neighbour primesMath 208Nested functionControl flow 209Nice primesMath 210Nim gameGames 211Number namesString 212Numbers divisible by their individual digits, but not by the product of their digitsMath 213Object serializationI/O 214Odd and square numbersMath 215Old lady swallowed a flyMisc 216Old Russian measure of lengthMath 217One-dimensional cellular automataControl flow 218Ordered wordsString 219Ormiston pairsMath 220Padovan n-step number sequencesMath 221Pairs with common factorsMath 222Palindrome datesMisc 223Palindrome detectionString 224Palindromic gapful numbersMath 225Palindromic primes in base 16Math 226Parsing/Shunting-yard algorithmData structures 227Partial function applicationMisc 228Pascal's triangleMath 229PentagramGraphics 230Periodic tableMisc 231Peripheral drift illusionGraphics 232Perlin noiseGraphics 233Permutation testMath 234PermutationsData structures 235Permutations with repetitionsData structures 236Permuted multiplesMath 237Phrase reversalsString 238Pick random elementMisc 239Pig the dice gameGames 240PiprimesMath 241Playing cardsGames 242Poker hand analyserGames 243Polynomial regressionMath 244PolyspiralGraphics 245Population countMath 246Prime conspiracyMath 247Priority queueData structures 248Probabilistic choiceMath 249Program nameMisc 250Pseudo-random numbers/Middle-square methodMath 251Pythagoras treeGraphics 252QuaternionMath 253Quickselect algorithmMath 254QuineMisc 255Random numbersMath 256Range expansionString 257Range extractionString 258Read a configuration fileI/O 259Read a file line by lineI/O 260Recaman's sequenceMath 261Reduced row echelon formMath 262Rep-stringString 263RepeatMisc 264Return multiple valuesControl flow 265Rock-paper-scissorsGames 266Roman numerals/DecodeMath 267Roman numerals/EncodeMath 268Rosetta Code/Rank languages by popularityMisc 269Rosetta_Code/Count_examplesMisc 270RPG attributes generatorGames 271Sattolo cycleData structures 272Search a list of recordsData structures 273Self-describing numbersMath 274SemordnilapString 275Sequence of non-squaresMath 276SHA-256 Merkle treeCrypto / encoding 277Short-circuit evaluationControl flow 278Show ASCII tableMisc 279Show the epochMisc 280Sierpinski carpetGraphics 281Sierpinski triangleGraphics 282Sieve of EratosthenesMath 283Sieve of PritchardMath 284Sleeping Beauty problemMisc 285Smallest numbersMath 286Snake and ladderGames 287Soloway's recurring rainfallMath 288Solve the no connection puzzleMisc 289Sort a list of object identifiersData structures 290Sort numbers lexicographicallyData structures 291Sort stabilityData structures 292Sort three variablesData structures 293Sort using a custom comparatorData structures 294Sorting algorithms/Bead sortData structures 295Sorting algorithms/BogosortData structures 296Sorting algorithms/Bubble sortData structures 297Sorting algorithms/Cocktail sortData structures 298Sorting algorithms/Comb sortData structures 299Sorting algorithms/Counting sortData structures 300Sorting algorithms/Gnome sortData structures 301Sorting algorithms/Insertion sortData structures 302Sorting algorithms/Patience sortData structures 303Sorting algorithms/Permutation sortData structures 304Sorting algorithms/QuicksortData structures 305Sorting algorithms/Radix sortData structures 306Sorting algorithms/Selection sortData structures 307Sorting algorithms/Shell sortData structures 308Sorting algorithms/Stooge sortData structures 309Sorting algorithms/Strand sortData structures 310SoundexString 311Sparkline in unicodeString 312Speech synthesisI/O 313Spiral matrixMath 314Stack tracesMisc 315Statistics/BasicMath 316Statistics/Normal distributionMath 317Stem-and-leaf plotData structures 318Straddling checkerboardCrypto / encoding 319String comparisonString 320String matchingString 321String prependnone 322Strip a set of characters from a stringString 323Strip block commentsString 324Strip whitespace from a string/Top and tailString 325Sub-unit squaresMath 326Substitution cipherCrypto / encoding 327Substring/Top and tailString 328Sudan functionMath 329SudokuMisc 330Sum digits of an integerMath 331Sum of a seriesMath 332Sum of first n cubesnone 333Sum of squaresMath 334Sum to 100Math 335Summation of primesMath 336Sunflower fractalGraphics 337Temperature conversionMath 338Terminal control/Restricted width positional input/No wrappingI/O 339Ternary logicMath 340Test a functionControl flow 341The sieve of SundaramMath 342The Twelve Days of ChristmasMisc 343Three word locationData structures 344Time a functionI/O 345Tokenize a string with escapingString 346Top rank per groupData structures 347Transliterate English text using the Greek alphabetString 348Truncate a fileI/O 349Twelve statementsMisc 350Two identical stringsnone 351Unicode stringsString 352Unicode variable namesMisc 353Unique charactersString 354Unique characters in each stringString 355Unix/lsI/O 356URL decodingI/O 357URL encodingI/O 358Useless instructionsControl flow 359Validate International Securities Identification NumberMath 360Variable declaration resetMisc 361VectorData structures 362Vector productsMath 363Vigenère cipherCrypto / encoding 364Voronoi diagramGraphics 365Walk a directory/Non-recursivelyI/O 366Walk a directory/RecursivelyI/O 367War card gameGames 368Water collected between towersMath 369Wave function collapseGraphics 370Word frequencyString 371Word wheelGames 372Word wrapString 373WordiffString 374Wordle comparisonGames 375Words from neighbour onesString 376Write entire fileI/O 377Write float arrays to a text fileI/O 378Write language name in 3D ASCIIGraphics 379XXXX redactedString 380Zeckendorf number representationMath 381Zig-zag matrixMath