Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

CODEA Enlightenment Project

edited October 2014 in General Posts: 91

I'm writing a CODEA project I call "CODEA Enlightenment"

With it, you will be able to "Display, Understand, Add Documentation and Edit CODEA Projects."

My goal is to understand existing CODEA source code even on small iPhone 6+ screens.

My method is to create a second CODEA project recording what I have learned but without duplicating the original code.

I am coding tokenizers and parsers to extract all class and function definitions and display their relationships graphically at any zoom level with minimal human work.

Once the information is extracted, you can manipulate it for your best Enlightenment.
What you do will be stored in the second CODEA project for recall at your next session.

I'm currently using the CargoBot example as a test case because it has a very sophisticated class structure and is available to everyone.

More as work progresses.

Comments

  • I have upgraded to iPad Air & CODEA 2.
    Lots of good stuff!

  • Jmv38Jmv38 Mod
    Posts: 3,295

    i am very imaptient to see this working!
    That would help a lot, i though about doing something similar but that is too large for my shoulders. However, when you publish the code i may help on improving it (if needed).

  • edited October 2014 Posts: 282

    @CodingOnNapkins — Sounds like a big project. This would be very helpful if you make it. I would suggest creating a repository on GitHub for the code while the project is still in progress, so people can help you easily.

  • edited October 2014 Posts: 91

    Here would be a photo of current progress if I could paste a photo in here.
    Oh for a paste key on apple keyboards!
    And where is the insert photo button described in https://www.dpchallenge.com/tutorial.php?TUTORIAL_ID=17#embedding ?

    Photo shows one box per tab giving lines containing "class("
    Can show lines containing "function " and "{"(for tables but overflows screen for Carbo-Bot.

    Next step extract class names and graph class structure
    But first extracting tokens from one line of code.

  • edited October 2014 Posts: 91

    I also posted this on the Bug discussion

    Looks like my CODEA Enlightenment project will be useful by extracting info from the code into views easy to read.

    I just did this with CODEA Enlightenment : I love pasteboard.copy()
    Improved format coming

    Class Overview for Cargo-Bot
    ABCMusic = class()
    BaseSelect = class(Screen)
    BaseStage = class(Panel)
    Button = class(SpriteObj)
    ChickenBox = class(Panel)
    Claw = class(Panel)
    Command = class(Button)
    Crate = class(Panel)
    CreditsScreen = class(Screen)
    Events = class()
    Goal = class(BaseStage)
    HowScreen = class(Screen)
    IO = class()
    Level = class(Screen)
    LevelItem = class(Panel)
    LevelItemStage = class(BaseStage)
    LevelSelect = class(BaseSelect)
    Music = class()
    PackItem = class(Panel)
    PackSelect = class(BaseSelect)
    Panel = class(PositionObj)
    Pile = class(Panel)
    Popover = class()
    PositionObj = class()
    Program = class(Panel)
    ProgressBar = class(Panel)
    RectObj = class(PositionObj)
    Register = class(Panel)
    Screen = class(Panel)
    ScrollingTexture = class(Panel)
    ShadowObj = class(SpriteObj)
    ShakeDetector = class()
    Smoke = class(Panel)
    Sounds = class()
    SplashScreen = class(Screen)
    SpriteObj = class(RectObj)
    Stack = class()
    Stage = class(BaseStage)
    StageWall = class(Panel)
    StartScreen = class(Screen)
    Table = class()
    Toolbox = class(Panel)
    TransitionScreen = class(Screen)
    Tweener = class()
    WinScreen = class(Screen)
    
  • Jmv38Jmv38 Mod
    Posts: 3,295

    i am a bit lost. Do you intend to post the code? Or just the great things you do with it?

  • @Jmv38 for now just output because CODEA Enlightenment code is still very much a work in progress

    I'll use Cargo-Bot because everyone has the source and it is a complex well written project.

    I'm sucking in the code directly from the CODEA sample code all of you got with CODEA.

  • Posts: 1,976

    This seems like a great idea, and I love a good challenge. Do you mind if I try and make my own version?

  • edited October 2014 Posts: 91

    @SkyTheCoder The more the merrier.

    To everyone, show me what you would like to see by putting sample layouts here.

    Now that I have learned about pasteboard.copy(), I can show CODEA Enlightenment output by putting output into strings since the screen shots didn't work.

    Oh, by the way, if you turn on assistive touch in settings>general>accessibility>assistive touch a little dot in a square appears on screen. Tap it, then Device then "... More" then Screenshot to get screen photo without all the holding down two buttons stuff. And you can lock the screen without using any physical buttons! You can move the assistive touch button anywhere on the edge of the screen to get it out of the way of another touch area.

  • dave1707dave1707 Mod
    edited October 2014 Posts: 7,677

    Here's something I had. I didn't have a use for it so I never really finished it. It may contain bugs. It's set up for Cargo-Bot.

    EDIT: It may take awhile for Cargo-Bot. You can scroll the text up or down.


    displayMode(FULLSCREEN) function setup() font("Courier") project="Cargo-Bot" -- change project name to what you want textMode(CORNER) dy=0 tab={} r=listProjectTabs(project) for a,b in pairs(r) do str=readProjectTab(project..":"..b) table.insert(tab,"\n") table.insert(tab,"\n") table.insert(tab,project.." : "..b) b1=1 s=1 comment=false startComment=false while true do s,e=string.find(str,"\n",s) if s==nil then break end s=e+1 str1=string.sub(str,b1,e) s1,e1=string.find(str1,"%-%-%[%[") if s1 ~= nil then startComment=true end s1,e1=string.find(str1,"%-%-%]%]") if s1 ~= nil then startComment=false end comment=false s1,e1=string.find(str1,"%-%-") if s1 ~= nil then comment=true end process=true if comment or startComment then process=false end if process then s1,e1=string.find(str1,"class") if s1~=nil then s2,e2=string.find(str1,")") if s2~= nil then table.insert(tab," "..string.sub(str1,1,e2)) b1=e2+1 end else s2,e2=string.find(str1,"function") if s2~=nil and s2==1 then s3,e3=string.find(str1,")") if s3~= nil then table.insert(tab," "..string.sub(str1,1,e3)) b1=e3+1 end end end if s==nil then break end end if e~=nil then b1=e+1 end end end table.insert(tab,"\n") table.insert(tab,"\n") table.insert(tab,"END of "..project) end function draw() background(40, 40, 50) fill(255) for a,b in pairs(tab) do text(b,100,HEIGHT-a*20+dy) end end function touched(t) if t.state==BEGAN or t.state==MOVING then dy=dy+t.deltaY if dy<0 then dy=0 end end end
Sign In or Register to comment.