SHARE
TWEET

token.c

_the_elf_ Oct 25th, 2013 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top