Results 1 to 8 of 8

Thread: Clean Programming Language

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    45

    Clean Programming Language

    I have found a programming language called 'Clean' on the internet. It is a 3rd party programming language, VERY complicated to learn, but EXTREMELY useful to use. I can't remember the URL to download it right now, but has anyone else got it??

    btw, here is a sample of the code from a game made in Clean

    Code:
    import StdEnv, StdIO, StdGameDef, StdGame, StdGSt, GameFunctions, Random, notes
    
    import WormsGfx  /* generated by Tile Studio */
    
    ::  GameState
        = { curlevel    :: !Int
          , maxlevel    :: !Int
          , quit        :: !Bool
          , wormlist    :: ![RealXY]
          , gameover    :: !Bool
          , timecounter :: !Int
          , randseed    :: !RandomSeed
          }
    
    initialGameState = { curlevel = 0
                       , maxlevel = 7
                       , quit = False
                       , wormlist = []
                       , gameover = False
                       , timecounter = 0
                       , randseed = nullRandomSeed
                       }
    
    /* move with speed V */
    
    V = 3.0  /* 24 rem V must be 0 */
    
    /* ---------- main program: load game definition and start the game! ---------- */
    
    Start :: *World -> *World
    Start world 
        # (seed, world) = getNewRandomSeed world
        = startGame WormsDemo {initialGameState & randseed = seed}
                  [ScreenSize {w = 640, h = 480}, ColorDepth 16] world
    
    /* ---------- the complete game definition ---------- */
    
    WormsDemo :: (Game GameState)
    WormsDemo =
        { levels = [ blankScreen
                   , GameLevel1
                   , blankScreen
                   , GameLevel2
                   , blankScreen
                   , GameLevel3
                   , blankScreen
                   ]
        , quitlevel = accGSt WormsQuitFunction
        , nextlevel = accGSt WormsNextLevelFunction
        , textitems = accGSt WormsTextItems
        }
    
    /* if the quit function returns true, the game engine quit the level */
    
    WormsQuitFunction :: GameState -> (Bool, GameState)
    WormsQuitFunction gst
        = (gst.quit, gst)
    
    /* function that returns the next level to run, 0 = end game */
    
    WormsNextLevelFunction :: GameState -> (Int, GameState)
    WormsNextLevelFunction gst =: {curlevel, maxlevel, gameover}
        = (nextLevel, {gst & curlevel = nextLevel
                           , quit = False
                           , timecounter = (time nextLevel)
                           })
    where
        nextLevel = if (gameover || (curlevel + 1 > maxlevel)) 0 (curlevel + 1)
        time l = if (l == maxlevel) 500 (if (l rem 2 == 1) 100 (~1))
    
    /* function that returns text to be displayed */
    
    WormsTextItems :: GameState -> ([GameText], GameState)
    WormsTextItems gst =: {curlevel, gameover, timecounter, maxlevel}
        #   gst = {gst & timecounter = timecounter - 1}
        |   gst.timecounter == 0
            = ([], {gst & quit = True})
        |   gameover
            |   timecounter < 0
                =   ([GameOver], {gst & timecounter = 250})
            =   ([GameOver], gst)
        =   if (curlevel == maxlevel)
                ([Ending1 timecounter, Ending2 timecounter], gst)
                (if (curlevel rem 2 == 1)
                    ([LevelStat ((curlevel + 1) / 2)], gst)
                    ([], gst)
                )

  2. #2
    Lively Member muzzi's Avatar
    Join Date
    May 2001
    Location
    syd.nsw.au
    Posts
    79
    looks like some wierd delphi / c hybrid.. cool..

    i want..

  3. #3

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    45

  4. #4
    Lively Member muzzi's Avatar
    Join Date
    May 2001
    Location
    syd.nsw.au
    Posts
    79
    excellent thanks heaps!

  5. #5
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Hey did you do any speed checks on that?
    The concepts seem intersting, but I am not really ready to invest time learning a language, that noone else programs in. I don't even know C so that would be the first new language for me to learn.
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Don't worry Misanthrop, I didn't know anything about Java/C++ when I learned a scripting language for a game based on that, and it was not that hard, since I already had all the programming concepts learned

    But anyway, I don't see anything in the code that allows you to fire, choose weapons, and all! Is it something like "Hello World"? A game would have to be more complex than that

    BTW, look at the front page of it - you can't say no one programs in it
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  7. #7
    Megatron
    Guest
    This looks similar to C.

  8. #8
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136

    some ppl

    You ppl are nuts. I don't get why any1 would bother to learn a lanuage as confusing as that. Euphoria's one of the most powerful languages i've ever used, and you can translate it 2 C and then compile it, so its ~95% as fast.
    BTW, Thanks for all your help

    Member of the anti-gay cross-dressing trans-species wolves alliance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width