1. Post #681
    Gold Member
    thrawn2787's Avatar
    April 2007
    8,524 Posts
    This is the only thread on Facepunch where everyone's friendly. I need to learn how to code.
    You're new to this thread aren't you (this statement isn't meant to be mean but this thread can really get at each others throats)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 5 (list)

  2. Post #682
    Gold Member
    Electroholic's Avatar
    June 2011
    2,319 Posts
    Building a Zilog Z80 computer on a breadboard. Fucking 16 bit wide address buses use all my wire :(



    Gunna write some assembly soon and write it to the ROM to start testing. Although its going to be hard with no output yet (I have to test the data and address lines manually :()
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Funny Funny x 9Programming King Programming King x 2Winner Winner x 1 (list)

  3. Post #683
    Gold Member
    Yogurt's Avatar
    December 2006
    1,089 Posts
    I want to write a little scripting language, but I don't know the best way to tokenize/parse such things. Also, I have no idea how the fuck a stack works.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 3Agree Agree x 2Funny Funny x 1Dumb Dumb x 1 (list)

  4. Post #684
    Gold Member
    foszor's Avatar
    April 2005
    930 Posts
    I want to write a little scripting language, but I don't know the best way to tokenize/parse such things. Also, I have no idea how the fuck a stack works.
    I want to build a house, but I don't know how to read home design plans. Also, I have no idea what the fuck a nail is.

    I didn't say that to mock you... its exactly how I feel whenever I have one of those "I wanna make a ...." ideas. I can never just make it, I have to learn eleventy new things before I can even start. By the time I learn everything I'm burnt out on the original idea.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 23Friendly Friendly x 1 (list)

  5. Post #685
    Gold Member
    Octave's Avatar
    January 2009
    2,530 Posts
    I want to write a little scripting language, but I don't know the best way to tokenize/parse such things. Also, I have no idea how the fuck a stack works.
    You can make some cool shit using lex and yacc (or bison) without worrying too much. They generate lexers and parsers, respectively, when you supply them with a set of rules (a grammar.)
    Reply With Quote Edit / Delete Linux United States Show Events

  6. Post #686
    RyanDv3's Avatar
    May 2008
    999 Posts
    Ryan, is your last name DallaValle?
    No, it's daniels
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 1 (list)

  7. Post #687
    Gold Member
    Yogurt's Avatar
    December 2006
    1,089 Posts
    I want to build a house, but I don't know how to read home design plans. Also, I have no idea what the fuck a nail is.

    I didn't say that to mock you... its exactly how I feel whenever I have one of those "I wanna make a ...." ideas. I can never just make it, I have to learn eleventy new things before I can even start. By the time I learn everything I'm burnt out on the original idea.
    My post was more of an "Explain this shit to me please" post.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 2Agree Agree x 1 (list)

  8. Post #688
    Map in a box's Avatar
    July 2009
    7,306 Posts
    Heres what I found, not sure if its what you want.

    https://developer.valvesoftware.com/...ave_Game_Files
    I've already stated that the valve wiki doesn't have what I need. Plus that doesn't describe the format, just how to use it in the engine.
    Reply With Quote Edit / Delete Windows XP United States Show Events Agree Agree x 1 (list)

  9. Post #689
    Gold Member
    Octave's Avatar
    January 2009
    2,530 Posts
    My post was more of an "Explain this shit to me please" post.
    A stack is just a data structure where whatever you add last comes off first:
    So say I have a stack of integers, to add something i would push it on the stack, to remove something I would pop it.
    Code:
    stack int_stack;
    push(int_stack, 3);
    
    Now, int_stack has one element: 3
    
    push(int_stack, 4);
    
    Now it looks like:
    4
    3
    
    int result;
    
    result = pop(int_stack);
    
    Popping it takes the top element off, so result == 4.
    
    result = pop(int_stack);
    
    Now result == 3 and the stack is empty.
    In terms of implementation, in C I've used a linked list where each member is a struct with form
    Code:
    struct stack_member {
      int data;
      struct stack_member *next;
    };
    I also have a master STACK struct that keeps track of the "head" or the first element - which, because each member points to the next, and more importantly because a stack is usually only operated on through pushing and popping on and off the top, is all you really need.
    Code:
    struct STACK {
      struct stack_member *head;
      int len;
    };
    For pushing, I malloc() a pointer to a stack member struct, set its data value equal to the value that was supplied to the push function, set its next pointer to the old head of the master STACK, and set the master STACK struct's head pointer to point to the newly allocated member. Thus, it has replaced the old head at the top of the stack.

    For popping, I copy the old head of the stack and set the head pointer of the master STACK to the next pointer member of the old head, so that the new head is the next stack element. I copy the old stack head's value, because you're going to be returning that, and then I free the old stack head and return the value. Thus the old stack head has been removed, the new stack head is now the previous second stack element, and the data of the popped stack element has been returned.

    This is how I've done it, it might not be a good way at all, but I hope this helps.
    Reply With Quote Edit / Delete Linux United States Show Events Useful Useful x 3Agree Agree x 2Dumb Dumb x 1 (list)

  10. Post #690
    Map in a box's Avatar
    July 2009
    7,306 Posts
    But he'd probably use C# so it wouldn't be that complicated. But it is useful.
    Reply With Quote Edit / Delete Windows XP United States Show Events

  11. Post #691
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    I want to build a house, but I don't know how to read home design plans. Also, I have no idea what the fuck a nail is.

    I didn't say that to mock you... its exactly how I feel whenever I have one of those "I wanna make a ...." ideas. I can never just make it, I have to learn eleventy new things before I can even start. By the time I learn everything I'm burnt out on the original idea.
    The magic of determination!
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #692
    Gold Member
    thrawn2787's Avatar
    April 2007
    8,524 Posts
    Probably late but oh google (android stuff)

    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 40Winner Winner x 1 (list)

  13. Post #693
    Catnip Cody
    cody8295's Avatar
    February 2009
    2,474 Posts
    Building a Zilog Z80 computer on a breadboard. Fucking 16 bit wide address buses use all my wire :(



    Gunna write some assembly soon and write it to the ROM to start testing. Although its going to be hard with no output yet (I have to test the data and address lines manually :()
    That's a nice breadboard :o I do stuff like that in class everyday.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 3 (list)

  14. Post #694
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Can you edit the world, like place and remove blocks?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #695
    benji2015's Avatar
    October 2010
    476 Posts
    Can you edit the world, like place and remove blocks?
    Yeah. Well, right now I just remove blocks in a certain area around the player. I'll add regular removing/placing later.

    Also I'm temporarily ditching the new meshes. They're making things a lot more difficult.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #696
    Gold Member
    synthiac's Avatar
    June 2007
    1,092 Posts
    Reply With Quote Edit / Delete Windows 7 United States Show Events Artistic x 7Informative x 3Friendly x 2Funny x 1Winner x 1 (list)

  17. Post #697
    a-k-t-w's Avatar
    March 2008
    3,195 Posts
    That looks good. Whatever it is. Maybe add a window title?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Agree Agree x 2 (list)

  18. Post #698
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Reply With Quote Edit / Delete Mac Australia Show Events Artistic Artistic x 14Programming King Programming King x 4Winner Winner x 4 (list)

  19. Post #699
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,223 Posts
    Squid,


    That green line looks like x + 2, not x + 1...
    The grid size is dynamic so that the lines don't get too spread out or packed in - in that shot, the squares are actually 1/2 a unit apart each, because it's slightly zoomed in :)

    Edited:

    Check the drawn area coords, bottom left, if you don't believe me ;)
    Reply With Quote Edit / Delete United Kingdom Show Events

  20. Post #700
    Gold Member
    BackwardSpy's Avatar
    May 2008
    6,504 Posts
    The grid size is dynamic so that the lines don't get too spread out or packed in - in that shot, the squares are actually 1/2 a unit apart each, because it's slightly zoomed in :)

    Edited:

    Check the drawn area coords, bottom left, if you don't believe me ;)
    It might be a good idea to draw the integer grid lines bolder than the fractional ones to make that obvious!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 7 (list)

  21. Post #701
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,223 Posts
    And doesn't the top function equate to this?
    Code:
    y = sqrt(x^2 + y^2)
    y^2 = x^2 + y^2
    0 = x^2
    0 = x
    Yet you made it look like: y = abs(x)
    The function was meant to be sqrt(x^2 + z^2); I was meaning to show the same relations in 2d vs 3d mode, but it looks like I didn't replace the first screenshot when I saw the typo :S and yeah, you're right, it ought to be a vertical line. What you're seeing there is the result of an explicit plot - it varies the x value and plots the y, so the y value can't get taken into account. It should be plotted correctly as an implicit relation. Or, I could "fix" it by iterating the evaluation I was also thinking of making explicit plots the default, it's fast enough now.

    Edited:

    It might be a good idea to draw the integer grid lines bolder than the fractional ones to make that obvious!
    Thanks, that's a good idea :) I was gonna just draw numbers all over it, but that seems a bit more elegant.
    Reply With Quote Edit / Delete United Kingdom Show Events Friendly Friendly x 1 (list)

  22. Post #702
    Gold Member
    BackwardSpy's Avatar
    May 2008
    6,504 Posts
    Thanks, that's a good idea :) I was gonna just draw numbers all over it, but that seems a bit more elegant.
    You could make it display the X/Y values of the current mouse position, snapped to the nearest gridline if it's under a certain distance away. That way there's no numbers spammed all over the graph but it's quick and easy to check a specific value.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 2 (list)

  23. Post #703
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Reply With Quote Edit / Delete Mac Australia Show Events Artistic Artistic x 14Winner Winner x 1Programming King Programming King x 1 (list)

  24. Post #704
    Simspelaaja's Avatar
    June 2008
    485 Posts
    You know, .NET can already load BMPs. I don't really see the point of the library.

    If it was just for the experience, it's impressive.
    It was just for the experience, since I have never before parsed something more complicated than INI files.
    Reply With Quote Edit / Delete Windows Vista Finland Show Events

  25. Post #705
    garry's Avatar
    September 2001
    12,398 Posts
    if you have something that needs to run every frame (like a spring), you'll be doing lookups quite often



    not really, in my experience it's quite clean. i suppose it really depends on the type of connections between your entities - in my case, ID's are pointless because objects connect through physical interactions

    you guys do bring up valid points, a solid ID system could be useful, but i just don't find it necessary in my current project. and it's certainly not worth the effort considering my current undo/redo system is perfectly fine in practice
    Wouldn't your spring maintain a connection to the physics object (by pointer) instead of the entity object?

    Seems like you should be re-thinking how those things work rather than designing the whole system around them.
    Reply With Quote Edit / Delete Windows 7 Show Events Agree Agree x 5 (list)

  26. Post #706
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,616 Posts
    Wouldn't your spring maintain a connection to the physics object (by pointer) instead of the entity object?
    So a spring game object should have pointers to physics bodies? What if one of those physics bodies is deleted it?

    Even if you're talking about a spring physics object (lower level than a game object), the same question applies: what if one of the bodies is destroyed?

    Edited:

    We're really debating a non-existend issue here so I'm out, I'll revive this entity ID vs. pointer debate if I actually run into wall
    Reply With Quote Edit / Delete Windows XP United States Show Events

  27. Post #707
    seandewar5's Avatar
    November 2010
    27 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Dumb Dumb x 9Funny Funny x 1 (list)

  28. Post #708
    Simspelaaja's Avatar
    June 2008
    485 Posts
    I'm impressed.

    Is it maintained in git? Have you considered using SVN?
    Mercurial is better!

    https://bitbucket.org/simssi/libbmpsharp/overview
    Reply With Quote Edit / Delete Windows Vista Finland Show Events Disagree Disagree x 6Agree Agree x 2Optimistic Optimistic x 1 (list)

  29. Post #709
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,223 Posts
    We used to have 5+ page arguments about how one person used this VCS and thought it was better than that VCS, and anybody who used a different one was sadly misguided. I'd rather not see that happen again... :S
    Anyway, on my way back now. Feeling pretty tired, but I'll get working on those suggestions once I'm back. Thanks guys :)

    Edited:

    As in, instead of "Mercurial's better!", say "I prefer Mercurial because of..." and let them make their own mind up :)
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 3 (list)

  30. Post #710
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,498 Posts
    except that was clearly a joke
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 4Optimistic Optimistic x 1 (list)

  31. Post #711
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,223 Posts
    I thought amcfaggot was joking, wasn't sure about that piggy bank guy. He sort of missed the window of opportunity for the joke, so I'd assumed he must be serious never mind, I'm back now, so on with the project!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  32. Post #712
    garry's Avatar
    September 2001
    12,398 Posts
    So a spring game object should have pointers to physics bodies? What if one of those physics bodies is deleted it?

    Even if you're talking about a spring physics object (lower level than a game object), the same question applies: what if one of the bodies is destroyed?

    Edited:

    We're really debating a non-existend issue here so I'm out, I'll revive this entity ID vs. pointer debate if I actually run into wall
    I would have entities using lookup by name. Then I would have the spring entity be attached by other entities by name. Then when it's all created I'd attach the physics objects by pointer. If one of the objects gets deleted I'd send a message to the spring physics object to detach it.

    Any messages coming from the entity would still do the entity lookup (activate, deactivate etc).
    Reply With Quote Edit / Delete Windows 7 Show Events

  33. Post #713
    Gold Member
    Darwin226's Avatar
    January 2009
    4,125 Posts
    We used to have 5+ page arguments about how one person used this VCS and thought it was better than that VCS, and anybody who used a different one was sadly misguided. I'd rather not see that happen again... :S
    Anyway, on my way back now. Feeling pretty tired, but I'll get working on those suggestions once I'm back. Thanks guys :)

    Edited:

    As in, instead of "Mercurial's better!", say "I prefer Mercurial because of..." and let them make their own mind up :)
    Honesly, in the last year or so every time someone mentions Git vs SVN people go "No no no, don't start that again!"
    I don't think there's anyone left willing to argue something as unimportant as that.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  34. Post #714
    bobiniki's Avatar
    December 2009
    423 Posts
    r0b0tsquid can you make this on your program and show it
    Code:
    x^2 + y^2 = n //replace n with a number like 1,2,3
    Reply With Quote Edit / Delete Windows XP Bulgaria Show Events

  35. Post #715
    Gold Member
    Darwin226's Avatar
    January 2009
    4,125 Posts
    r0b0tsquid can you make this on your program and show it
    Code:
    x^2 + y^2 = n //replace n with a number like 1,2,3
    Already showed circles.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 3 (list)

  36. Post #716
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,223 Posts
    r0b0tsquid can you make this on your program and show it
    Code:
    x^2 + y^2 = n //replace n with a number like 1,2,3

    Like that? I added implicits a while ago, it does implicit inequalites and such as well :)
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Artistic Artistic x 1Friendly Friendly x 1Winner Winner x 1 (list)

  37. Post #717
    bobiniki's Avatar
    December 2009
    423 Posts

    Like that? I added implicits a while ago, it does implicit inequalites and such as well :)
    Oh thanks. I learned this function yesterday but I didn't believe that it's for circle, but still I know all other functions like trigonometry, logarithmic, etc.
    Reply With Quote Edit / Delete Windows XP Bulgaria Show Events Funny Funny x 12Friendly Friendly x 1 (list)

  38. Post #718
    Gold Member
    Darwin226's Avatar
    January 2009
    4,125 Posts
    Oh thanks. I learned this function yesterday but I didn't believe that it's for circle, but still I know all other functions like trigonometry, logarithmic, etc.
    The rule it describes is that every point on the circle is equally distanced from the center. And it does so with the Pythagoras' theorem. x^2 + y^2 = r^2
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 2 (list)

  39. Post #719
    Gold Member
    HeroicPillow's Avatar
    July 2009
    4,643 Posts
    Oh thanks. I learned this function yesterday but I didn't believe that it's for circle, but still I know all other functions like trigonometry, logarithmic, etc.
    You could've just used wolframalpha if that's all you wanted.

    http://www.wolframalpha.com/input/?i...y%5E2+%3D+3%7D
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 4 (list)

  40. Post #720
    Garry doesn't deserve a penny of my money
    AzzyMaster's Avatar
    October 2008
    1,165 Posts
    Working on a FP Mobile app, hopefully this one won't go the route of all of the other attempts. I've got login, forum list and thread list for a forum working in my backend. And I've got login and forum list working in the app.

    Here's a screenie:
    Reply With Quote Edit / Delete Windows 7 Russian Federation Show Events Winner Winner x 23Programming King Programming King x 2Dumb Dumb x 1 (list)