Advertisement
Guest User

Untitled

a guest
Nov 10th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.47 KB | None | 0 0
  1. /*!
  2. ** This file has been generated, if you wish to
  3. ** modify it in a permanent way, please refer
  4. ** to the script file : gen/generator_c.rb
  5. */
  6.  
  7. #pragma once
  8.  
  9. #include <stdlib.h>
  10. #include <stdbool.h>
  11.  
  12. /*!
  13. ** All possible error types that can be returned by action functions
  14. */
  15. typedef enum error {
  16.   OK, /* <- no error occurred */
  17.   OUT_OF_BOUNDS, /* <- provided position is out of bounds */
  18.   ALREADY_OCCUPIED, /* <- someone already played at the provided position */
  19.   ALREADY_PLAYED, /* <- you already played this turn, you cheater! */
  20. } error;
  21.  
  22.  
  23. struct position;
  24.  
  25. typedef struct int_array {
  26.   int* datas;
  27.   size_t length;
  28. } int_array;
  29.  
  30. /*!
  31. ** Position on the TicTacToe board
  32. */
  33. typedef struct position {
  34.   int x;  /* <- X coordinate */
  35.   int y;  /* <- Y coordinate */
  36. } position;
  37.  
  38.  
  39. /*!
  40. ** Play at the given position
  41. */
  42. error play(position pos);
  43.  
  44. /*!
  45. ** Returns your team number
  46. */
  47. int my_team(void);
  48.  
  49. /*!
  50. ** Returns the TicTacToe board
  51. */
  52. int_array board(void);
  53.  
  54. /*!
  55. ** Cancels the last played action
  56. */
  57. bool cancel(void);
  58.  
  59. /*!
  60. ** Affiche le contenu d'une valeur de type error
  61. */
  62. void afficher_error(error v);
  63.  
  64. /*!
  65. ** Affiche le contenu d'une valeur de type position
  66. */
  67. void afficher_position(position v);
  68.  
  69. /*!
  70. ** Function called at the start of the game
  71. */
  72. void init_game(void);
  73.  
  74. /*!
  75. ** Called when this is your turn to play
  76. */
  77. void play_turn(void);
  78.  
  79. /*!
  80. ** Function called at the end of the game
  81. */
  82. void end_game(void);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement