Skip to content

pointless-lang/pointless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pointless logo Pointless

A Language for Learning

fn step(n)
  if n % 2 == 0 then n / 2 else n * 3 + 1 end
end

fn hailstone(n)
  values = [n]

  while n > 1 do
    n |= step
    values |= push(n)
  end

  values
end

bars = chars("▁▂▃▄▅▆▇█")

fn getBar(n, maxVal)
  scaled = 8 * (n - 1) / (maxVal - 1)
  bars[Math.min(Math.floor(scaled), 7)]
end

fn chart(values)
  values
    $ getBar(max(values))
    | join("")
end

hailstone(78)
  | chart
  | print
▃▂▄▂▅▃█▄▂▆▃█▄▂▁▁▂▁▃▂▁▁▁▁▂▁▁▂▁▁▁▁▁▁▁▁

Installing

Using Node.js with npm:

npm install --global https://github.com/pointless-lang/pointless/

About

Pointless: a scripting language for learning and fun

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages