1. Home
  2. /
  3. Rebol-red
  4. /
  5. REBOL / Red Prime Checker

REBOL / Red Prime Checker - Rebol-red Typing CST Test

Loading…

REBOL / Red Prime Checker — Rebol-red Code

Checks if numbers are prime.

isPrime: func [n] [
	if n < 2 [return false]
	foreach i 2 n-1 [
		if n // i = 0 [return false]
	]
	return true
]

nums: [7 10 13]
foreach n nums [
	print rejoin [n " is " either isPrime n ["Prime"] ["Not Prime"]]
]

Rebol-red Language Guide

Rebol and its modern descendant Red are high-level, cross-platform programming languages designed for simplicity, domain-specific languages, and full-stack development. Rebol emphasizes compact syntax and data exchange, while Red adds native compilation, GUI support, and system-level capabilities.

Primary Use Cases

  • ▸Scripting and automation
  • ▸Cross-platform GUI applications
  • ▸Domain-specific language creation
  • ▸Networking and internet protocols
  • ▸Rapid prototyping and native applications (Red)

Notable Features

  • ▸Minimalist, expressive syntax
  • ▸Dialect-based programming (DSLs)
  • ▸Cross-platform support (Red: native binaries)
  • ▸GUI library support (Red/View)
  • ▸Dynamic typing with optional static types (Red)

Origin & Creator

Rebol was created by Carl Sassenrath in 1997 to enable efficient data exchange and scripting. Red was initiated in 2011 by Nenad Rakocevic as a modern, native successor to Rebol.

Industrial Note

Rebol/Red excels in small-footprint tools, cross-platform GUI apps, DSL creation, and scripting tasks that benefit from concise syntax and runtime flexibility.

More Rebol-red Typing Exercises

REBOL / Red Counter and Theme ToggleREBOL / Red Random Number GeneratorREBOL / Red Todo ListREBOL / Red Dice RollerREBOL / Red Countdown TimerREBOL / Red Temperature ConverterREBOL / Red Shopping CartREBOL / Red Name GreetingREBOL / Red Stopwatch

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher