Advertisement
_the_elf_

token.c

Oct 25th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "token.h"
  3.  
  4. void create(token *t, int value)
  5. {
  6.     t->currentPosition = value;
  7.     t->direction = 1;
  8. }
  9.  
  10. void move(token *t, int value)
  11. {
  12.     if (t->direction == 1)
  13.     {
  14.         t->currentPosition += value;
  15.     }
  16.     else
  17.     {
  18.         t->currentPosition -= value;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement