Answers.Body: <p>You're asking code for validating a chess position. There're a <strong>lot</strong>, tons and tons libraries. However, I don't think there's anything that you can compile for StarCraft. Consider:</p>
  
  <ol>
  <li>Learn chess yourself. Make sure you know the rules well.</li>
  <li>There's <strong>nothing</strong> you can just grab for your project. You'll need to do it yourself. If speed is not important, you could encode the chess board as a 8x8 two-dimensional arrays. Simple programming. Loop throught the arrays for moves, slow but it'll work for sure.</li>
  <li>If speed is important, consider bitboard implementation. Please google bitboard for chess.</li>
  </ol>
  
  <p>Some references:</p>
  
  <ul>
  <li><a href="https://github.com/niklasf/python-chess" rel="nofollow noreferrer">https://github.com/niklasf/python-chess</a></li>
  <li><a href="https://github.com/official-stockfish" rel="nofollow noreferrer">https://github.com/official-stockfish</a></li>
  <li><a href="https://github.com/jhlywa/chess.js/" rel="nofollow noreferrer">https://github.com/jhlywa/chess.js/</a></li>
  </ul>
  
  <p>and many many more. Decide your programming language. Your question is too broad for us to answer.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-02T11:10:39.900Z
Answers.Text: Good advices. Tiny addition: chessprogramming wikispace https://chessprogramming.wikispaces.com is a great resource for all your algorithmic questions with lots of references too. Make sure you read some of their main articles on move generation and validation for example. SmallChess has also given you link to mature open-source projects, so e.g. you can open the source code of python-chess and learn from it the basics of board encoding and generation of legal moves.
Answers.UserDisplayName: user929304
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-02T13:03:01.913Z
Answers.Text: And once you start coding, if you face concrete problems in your development, then you can post new questions here on chess SE (chess programming related questions often appear here, specially if the question is not vague), and I know at least two decent users (SmallChess and Phonon) who would be able to see to your questions. Good luck!
Answers.UserDisplayName: user929304
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-02T13:03:42.517Z
Answers.Text: @user929304 That's right. I voted to close the question because it's too broad.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-02T09:25:36.770Z
Answers.LastActivityDate: 2018-02-02T11:16:49.307Z
Answers.LastEditDate: 2018-02-02T11:16:49.307Z
Answers.UserDisplayName: SmallChess
Body: <p>It's my first question on the chess stack exchange (actually I asked this question to stack overflow but my question was closed 'off topic'), and English is not my first language. So please understand if my explanation is not clear.</p>
  
  <p>I'm a programming novice. I can use some of C (actually I forgot even basics of C), python, IDL just for scientific calculations, or for graphing.</p>
  
  <p>I'm a moderate custom map maker for Starcraft 1. Yes, old fashioned game. Till lately only algorithm I need to make an custom map in Starcraft was trigger, which consists of condition(if~) and action(do~). There was no more complex algorithm like loop or like that.</p>
  
  <p>However, recently there were much advance in the technology of making custom map with the popularization of EUD trigger.</p>
  
  <p>EUD stands for Extended Unit death Trigger. There is an action in Starcraft trigger named 'Set Death'. The point is, you can set the death value of certain unit (of certain player) outside the allowed range. That makes possible to access and change other game data, like unit attack range or unit appearance(though extreme exploitation were limited in Starcraft:Remastered)</p>
  
  <p>And one map maker (and programmer) made a programming language named epScript in which you can program a custom map and that would compile your script into Starcraft triggers and automatically embed them in a map.</p>
  
  <p>And he wrote some lectures about how to use the language and compiler and the example he chose was the Chess. <a href="https://github.com/phu54321/euddraft/wiki" rel="nofollow noreferrer">https://github.com/phu54321/euddraft/wiki</a></p>
  
  <p>So you can play Chess in Starcraft Battlenet. (Well it was possible before when EUD was enabled but it was a result of such a lot of labor.)</p>
  
  <p>However unfortunately he has stopped midway and I have some reasons to believe that for a while he'd not complete his lectures. So I'd like to continue and complete the chess map for two person, and besides, I wanna apply the principle to make a variant of chess, Kriegspiel, which is one of my favorite board game. <a href="https://en.wikipedia.org/wiki/Kriegspiel_(chess)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Kriegspiel_(chess)</a></p>
  
  <p>Anyway, before that, I want to make chess (PvP). But as I said, I'm novice in programming, so I'm not accustomed to make algorithms to realize chess mechanism. So like, I'm not sure how to make script for disabling king to go into a checked cell.</p>
  
  <p>Are there some webpages that lists algorithms for chess making , not language-dependent? I don't want AI algorithm for chess.(well after I finish the job, if I have enough time I may invest some time for that to enable PvC. And maybe for Kriegspiel too..?) I just want algorithms to implement chess rules. Thanks.</p>
  
Tags: <rules><computer-chess>
Title: Algorithm for implementing chess rule
ThreadText: # Algorithm for implementing chess rule
  
  (Asked by: username_0 on 2018-02-02)
  
  It's my first question on the chess stack exchange (actually I asked this question to stack overflow but my question was closed 'off topic'), and English is not my first language. So please understand if my explanation is not clear.
  
  I'm a programming novice. I can use some of C (actually I forgot even basics of C), python, IDL just for scientific calculations, or for graphing.
  
  I'm a moderate custom map maker for Starcraft 1. Yes, old fashioned game. Till lately only algorithm I need to make an custom map in Starcraft was trigger, which consists of condition(if~) and action(do~). There was no more complex algorithm like loop or like that.
  
  However, recently there were much advance in the technology of making custom map with the popularization of EUD trigger.
  
  EUD stands for Extended Unit death Trigger. There is an action in Starcraft trigger named 'Set Death'. The point is, you can set the death value of certain unit (of certain player) outside the allowed range. That makes possible to access and change other game data, like unit attack range or unit appearance(though extreme exploitation were limited in Starcraft:Remastered)
  
  And one map maker (and programmer) made a programming language named epScript in which you can program a custom map and that would compile your script into Starcraft triggers and automatically embed them in a map.
  
  And he wrote some lectures about how to use the language and compiler and the example he chose was the Chess. <https://github.com/phu54321/euddraft/wiki>
  
  So you can play Chess in Starcraft Battlenet. (Well it was possible before when EUD was enabled but it was a result of such a lot of labor.)
  
  However unfortunately he has stopped midway and I have some reasons to believe that for a while he'd not complete his lectures. So I'd like to continue and complete the chess map for two person, and besides, I wanna apply the principle to make a variant of chess, Kriegspiel, which is one of my favorite board game. <https://en.wikipedia.org/wiki/Kriegspiel_(chess)>
  
  Anyway, before that, I want to make chess (PvP). But as I said, I'm novice in programming, so I'm not accustomed to make algorithms to realize chess mechanism. So like, I'm not sure how to make script for disabling king to go into a checked cell.
  
  Are there some webpages that lists algorithms for chess making , not language-dependent? I don't want AI algorithm for chess.(well after I finish the job, if I have enough time I may invest some time for that to enable PvC. And maybe for Kriegspiel too..?) I just want algorithms to implement chess rules. Thanks.
  
  **Tags:** rules, computer-chess
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-02. Score: 2
  
  You're asking code for validating a chess position. There're a **lot**, tons and tons libraries. However, I don't think there's anything that you can compile for StarCraft. Consider:
  
  1. Learn chess yourself. Make sure you know the rules well.
  2. There's **nothing** you can just grab for your project. You'll need to do it yourself. If speed is not important, you could encode the chess board as a 8x8 two-dimensional arrays. Simple programming. Loop throught the arrays for moves, slow but it'll work for sure.
  3. If speed is important, consider bitboard implementation. Please google bitboard for chess.
  
  Some references:
  
  * <https://github.com/niklasf/python-chess>
  * <https://github.com/official-stockfish>
  * <https://github.com/jhlywa/chess.js/>
  
  and many many more. Decide your programming language. Your question is too broad for us to answer.
  
  > **Comments:**
  > **username_2**: Good advices. Tiny addition: chessprogramming wikispace https://chessprogramming.wikispaces.com is a great resource for all your algorithmic questions with lots of references too. Make sure you read some of their main articles on move generation and validation for example. username_1 has also given you link to mature open-source projects, so e.g. you can open the source code of python-chess and learn from it the basics of board encoding and generation of legal moves.  
  > **username_2**: And once you start coding, if you face concrete problems in your development, then you can post new questions here on chess SE (chess programming related questions often appear here, specially if the question is not vague), and I know at least two decent users (username_1 and Phonon) who would be able to see to your questions. Good luck!  
  > **username_1**: @username_2 That's right. I voted to close the question because it's too broad.  
  
  ---
  
  