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 100EntropyMath 101Ethiopian multiplicationMath 102Euclidean rhythmMisc 103Euler methodMath 104Euler's constant 0.5772...Math 105Evolutionary algorithmMisc 106Exactly three adjacent 3 in listsData structures 107Execute Brain****Misc 108Extend your languageMisc 109Extensible prime generatorMath 110FASTA formatI/O 111Fibonacci sequenceMath 112File extension is in extensions listString 113File modification timeI/O 114Find common directory pathString 115Find first missing positiveData structures 116Find limit of recursionControl flow 117Find prime n such that reversed n is also primeMath 118Find unimplemented tasksMisc 119Find words with alternating vowels and consonantsenone 120First-class functions/Use numbers analogouslyControl flow 121Five weekendsMisc 122Flipping bits gamenone 123Floyd's trianglenone 124Forest fireGraphics 125Four is magicMisc 126Fractal treeGraphics 127Fraction reductionMath 128FractranMath 129Gamma functionMath 130Gapful numbersMath 131Generate lower case ASCII alphabetString 132Generate random numbers without repeating a valueData structures 133Get system command outputI/O 134Go FishGames 135Gosper's hackMisc 136Gray codeMath 137Grayscale imageGraphics 138GreedGames 139GSTrans string conversionString 140Happy numbersMath 141Harriss SpiralGraphics 142Hash joinData structures 143Hello world/Standard errorI/O 144Hello world/Web servernone 145Here documentString 146Heronian trianglesMath 147Hex dumpData structures 148Huffman codingCrypto / encoding 149I before E except after CString 150IBANMath 151Image noiseGraphics 152Include a fileControl flow 153Increment loop index within loop bodyControl flow 154InfinityMath 155Integer overflowMath 156Integer sequenceMath 157IntrospectionControl flow 158Inverted indexData structures 159ISBN13 check digitMath 160Jacobsthal numbersMath 161JSON pointerString 162Julia setGraphics 163Knapsack problem/0-1Math 164Knapsack problem/BoundedMath 165Knapsack problem/ContinuousMath 166Knapsack problem/UnboundedMath 167Knight's tourGames 168Knuth shuffleData structures 169Kronecker productMath 170Kronecker product based fractalsMath 171Largest number divisible by its digitsMath 172Leap yearMisc 173Legendre prime counting functionMath 174Letter frequencyString 175Levenshtein distanceString 176Long multiplicationMath 177Long yearMath 178Longest common suffixString 179Longest string challengeString 180Look-and-say sequenceMath 181Loops/With multiple rangesControl flow 182Loops/Wrong rangesControl flow 183Ludic numbersMath 184Luhn test of credit card numbersMath 185Lychrel numbersMath 186Lyndon wordString 187LZW compressionCrypto / encoding 188Mandelbrot setGraphics 189Markov chain text generatorString 190Mayan numeralsMisc 191Maze generationGraphics 192MD4Crypto / encoding 193Memory allocationMisc 194Minimum numbers of three listsData structures 195Minimum primesMath 196Morse codeCrypto / encoding 197MultitonMisc 198Munching squaresGraphics 199Möbius functionMath 200N'thString 201Named parametersMisc 202Naming conventionsMisc 203Natural sortingData structures 204Nautical bellMisc 205Neighbour primesMath 206Nested functionControl flow 207Nice primesMath 208Nim gameGames 209Number namesString 210Numbers divisible by their individual digits, but not by the product of their digitsMath 211Object serializationI/O 212Odd and square numbersMath 213Old lady swallowed a flyMisc 214Old Russian measure of lengthMath 215One-dimensional cellular automataControl flow 216Ordered wordsString 217Ormiston pairsMath 218Padovan n-step number sequencesMath 219Pairs with common factorsMath 220Palindrome datesMisc 221Palindrome detectionString 222Palindromic gapful numbersMath 223Palindromic primes in base 16Math 224Parsing/Shunting-yard algorithmData structures 225Partial function applicationMisc 226Pascal's triangleMath 227PentagramGraphics 228Periodic tableMisc 229Peripheral drift illusionGraphics 230Perlin noiseGraphics 231Permutation testMath 232PermutationsData structures 233Permutations with repetitionsData structures 234Permuted multiplesMath 235Phrase reversalsString 236Pick random elementMisc 237Pig the dice gameGames 238PiprimesMath 239Playing cardsGames 240Poker hand analyserGames 241Polynomial regressionMath 242PolyspiralGraphics 243Population countMath 244Prime conspiracyMath 245Priority queueData structures 246Probabilistic choiceMath 247Program nameMisc 248Pseudo-random numbers/Middle-square methodMath 249Pythagoras treeGraphics 250QuaternionMath 251Quickselect algorithmMath 252QuineMisc 253Random numbersMath 254Range expansionString 255Range extractionString 256Read a configuration fileI/O 257Read a file line by lineI/O 258Recaman's sequenceMath 259Reduced row echelon formMath 260Rep-stringString 261RepeatMisc 262Return multiple valuesControl flow 263Rock-paper-scissorsGames 264Roman numerals/DecodeMath 265Roman numerals/EncodeMath 266Rosetta Code/Rank languages by popularityMisc 267Rosetta_Code/Count_examplesMisc 268RPG attributes generatorGames 269Sattolo cycleData structures 270Search a list of recordsData structures 271Self-describing numbersMath 272SemordnilapString 273Sequence of non-squaresMath 274SHA-256 Merkle treeCrypto / encoding 275Short-circuit evaluationControl flow 276Show ASCII tableMisc 277Show the epochMisc 278Sierpinski carpetGraphics 279Sierpinski triangleGraphics 280Sieve of EratosthenesMath 281Sieve of PritchardMath 282Sleeping Beauty problemMisc 283Smallest numbersMath 284Soloway's recurring rainfallMath 285Solve the no connection puzzleMisc 286Sort a list of object identifiersData structures 287Sort numbers lexicographicallyData structures 288Sort stabilityData structures 289Sort three variablesData structures 290Sort using a custom comparatorData structures 291Sorting algorithms/Bead sortData structures 292Sorting algorithms/BogosortData structures 293Sorting algorithms/Bubble sortData structures 294Sorting algorithms/Cocktail sortData structures 295Sorting algorithms/Comb sortData structures 296Sorting algorithms/Counting sortData structures 297Sorting algorithms/Gnome sortData structures 298Sorting algorithms/Insertion sortData structures 299Sorting algorithms/Patience sortData structures 300Sorting algorithms/Permutation sortData structures 301Sorting algorithms/QuicksortData structures 302Sorting algorithms/Radix sortData structures 303Sorting algorithms/Selection sortData structures 304Sorting algorithms/Shell sortData structures 305Sorting algorithms/Stooge sortData structures 306Sorting algorithms/Strand sortData structures 307SoundexString 308Sparkline in unicodeString 309Speech synthesisI/O 310Spiral matrixMath 311Stack tracesMisc 312Statistics/Normal_distributionMath 313Stem-and-leaf plotData structures 314Straddling checkerboardCrypto / encoding 315String comparisonString 316String matchingString 317String prependnone 318Strip a set of characters from a stringString 319Strip block commentsString 320Strip whitespace from a string/Top and tailString 321Sub-unit squaresMath 322Substitution cipherCrypto / encoding 323Substring/Top and tailString 324Sudan functionMath 325SudokuMisc 326Sum digits of an integerMath 327Sum of a seriesMath 328Sum of first n cubesnone 329Sum of squaresMath 330Sum to 100Math 331Summation of primesMath 332Temperature conversionMath 333Terminal control/Restricted width positional input/No wrappingI/O 334Ternary logicMath 335Test a functionControl flow 336The sieve of SundaramMath 337The Twelve Days of ChristmasMisc 338Three word locationData structures 339Time a functionI/O 340Tokenize a string with escapingString 341Top rank per groupData structures 342Transliterate English text using the Greek alphabetString 343Truncate a fileI/O 344Twelve statementsMisc 345Two identical stringsnone 346Unicode stringsString 347Unicode variable namesMisc 348Unique charactersString 349Unique characters in each stringString 350Unix/lsI/O 351URL decodingI/O 352URL encodingI/O 353Useless instructionsControl flow 354Validate International Securities Identification NumberMath 355Variable declaration resetMisc 356VectorData structures 357Vector productsMath 358Vigenère cipherCrypto / encoding 359Voronoi diagramGraphics 360Walk a directory/Non-recursivelyI/O 361Walk a directory/RecursivelyI/O 362War card gameGames 363Water collected between towersMath 364Wave function collapseGraphics 365Word frequencyString 366Word wheelGames 367Word wrapString 368WordiffString 369Wordle comparisonGames 370Words from neighbour onesString 371Write entire fileI/O 372Write float arrays to a text fileI/O 373Write language name in 3D ASCIIGraphics 374XXXX redactedString 375Zeckendorf number representationMath 376Zig-zag matrixMath