Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Stars

Stars is a classic forth example in which for a height of 20 lines, it draws 40 stars wide, and for each x y % 0 = draws a star, it should look like this:

****************************************
 * * * * * * * * * * * * * * * * * * * *
  *  *  *  *  *  *  *  *  *  *  *  *  * 
   *   *   *   *   *   *   *   *   *   *
    *    *    *    *    *    *    *    *
     *     *     *     *     *     *    
      *      *      *      *      *     
       *       *       *       *       *
        *        *        *        *    
         *         *         *         *
          *          *          *       
           *           *           *    
            *            *            * 
             *             *            
              *              *          
               *               *        
                *                *      
                 *                 *    
                  *                  *  
                   *                   *

Uxntal

|0100 ( -> )
    #1501
    &for-i ( limit i -- )
        STHk #2901
        &for-j ( limit j -- )
            DUP STHkr DIVk MUL SUB
            #202a ROT ?{ SWP } POP #18 DEO
            INC GTHk ?&for-j
        POP2 POPr
        #0a18 DEO
        INC GTHk ?&for-i
    POP2
BRK

Factor

: draw-stars ( -- )
    20 [1..b] [ 
       40 [1..b] swap '[ 
          _ divisor? "*" " " ? write
       ] each nl
    ] each ;

This revision created on Fri, 8 Mar 2024 20:06:42 by SnufkinVC (Format tal example.)

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.