Search:

Type: Posts; User: hwing91

Search: Search took 0.02 seconds.

  1. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Hmm okay thanks, ill have to think about how im...

    Hmm okay thanks, ill have to think about how im going to get this working.
  2. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Oh yeah sorry, I used that code. The...

    Oh yeah sorry, I used that code.

    The delete_position() works fine, I had an error in something else that I fixed.

    So draw_ball() isn't suppose to draw 3 balls? It seems like its drawing the...
  3. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    So now that i've fixed the collision detection to...

    So now that i've fixed the collision detection to register for multiple balls, right off the bat if I draw two balls everything works fine.
    If I draw one, then have a condition that add_position()'s...
  4. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    AHHHHHHHHHHHHHHH, I see. Thank you SO much again....

    AHHHHHHHHHHHHHHH, I see. Thank you SO much again. I think im done with my code, all I have to do is tweak my collision detection and implement adding/removing balls and im done.
  5. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    So i've been working on it a bit and I've decided...

    So i've been working on it a bit and I've decided to have a linked list with the data of the position of the balls, and a draw_ball function that cycles through the linked list and draws all the...
  6. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    We program C in netbeans and we use VBA to...

    We program C in netbeans and we use VBA to perform tasks. I'm making a game, with my premade drawRect and drawCircle functions that work correctly.

    I plan on having balls (at the head of the node)...
  7. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Ah I see so positions->next->next->col...

    Ah I see so


    positions->next->next->col //would access my last(third) right?


    I guess I could write a function to make it easier if I had alot more nodes. Thanks again!!
  8. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Not random access, accessing certain nodes, for...

    Not random access, accessing certain nodes, for example, the second node I stored.
  9. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Okay thanks. Is it possible to access certain...

    Okay thanks. Is it possible to access certain nodes with this method without looping through all of them as you did? Or would I have to write a more complex linked list function?



    void...
  10. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Hmm I have a few questions again. I'll comment...

    Hmm I have a few questions again. I'll comment them in the code you helped me with.

    Would this function be correct in deleting the first node in that linked list?


    void add_position(Position**...
  11. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    No yeah, I plan on adding multiple balls and...

    No yeah, I plan on adding multiple balls and removing them depending on circumstances, I can see the usefulness already, its just the syntax that's confusing more so.

    My project proposal is to...
  12. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Okay thanks! So this is my definition so far....

    Okay thanks!

    So this is my definition so far.

    typedef struct _position{
    int row;
    int col;
    struct _position *next;
    }Position;
    Position* positions =...
  13. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Would this be correct in declaring a...

    Would this be correct in declaring a singly-linked list then, if i only wanted these three?


    typedef struct _position{
    int row;
    int col;
    struct _position *next;
    ...
  14. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Hm okay...I'm still confused on the syntax on how...

    Hm okay...I'm still confused on the syntax on how to define a linked list and access nodes from them.

    So if I wanted to begin to change my storage into a linked list method, would something like...
  15. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Yeah whoops, thanks alot for your help so far...

    Yeah whoops, thanks alot for your help so far lol, my professor really doesn't do anything to aid us in our class.

    So I just read a quick article about them.

    So, bare with me since I really do...
  16. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Hmm maybe my understanding of dynamic memory...

    Hmm maybe my understanding of dynamic memory isn't as good as I thought, in class thats how we were always taught to create a structure and store elements into it.

    That is the code im using to...
  17. Thread: Linked Lists?!

    by hwing91
    Replies
    32
    Views
    4,591

    Linked Lists?!

    Hello! I am taking a beginning C class at my school and the requirements for this homework is to make a game using linked lists.
    The requirements with linked lists are
    - To draw elements of linked...
Results 1 to 17 of 17