filmov
tv
Excel VBA Chess Challenge #4 - For Next Loop, Offset and Variables

Показать описание
Can we create a chess computer in an Excel spreadsheet using Excel VBA?
Download the file used in this video here:
Spreadsheet Skunkworks playlist here:
***Puppy cameo at end of video***
Welcome to the Spreadsheet Skunkworks!
In this video series, Chris tests the boundaries of what is possible in Excel. You will not find the usual step-by-step tuition here; the focus is on experimentation and creativity. Expect plenty of coding challenges, and some nice surprises about what is possible in Excel...
Some key questions:
- How can we represent a chess board and chess pieces in Excel?
- Can we make Excel understand where the pieces can move?
- Can we 'teach' Excel some simple chess principles (capture the other pieces, move your pieces to good squares), and get Excel to recommend a move to make?
We currently have a chess board, but no pieces! In the fourth video in the series, we explore how to create the 'pieces', and position them accurately. It would be possible to do this 'manually' using shapes and dragging them around the board; but, it would be better to automate this process with a 'reset' button, to set the pieces up for a new game.
What coding techniques are required to get this job done? Chess comprises 32 pieces in total, so we'll use a loop, combined with a table in the spreadsheet, to repeat the 'positioning' process while changing important details for each piece. Some Tiger favourites are on show here including the offset command, integer variables. We'll also create a 'backend' sheet to hold information that the user does not need to see.
What do you think about the Spreadsheet Skunkworks series? Do you have any ideas for Chris? Don't forget to leave a comment.
Get in touch with Tiger using the platforms below!
For regular spreadsheet hints and tips and more on the #ExcelRevolution:
Download the file used in this video here:
Spreadsheet Skunkworks playlist here:
***Puppy cameo at end of video***
Welcome to the Spreadsheet Skunkworks!
In this video series, Chris tests the boundaries of what is possible in Excel. You will not find the usual step-by-step tuition here; the focus is on experimentation and creativity. Expect plenty of coding challenges, and some nice surprises about what is possible in Excel...
Some key questions:
- How can we represent a chess board and chess pieces in Excel?
- Can we make Excel understand where the pieces can move?
- Can we 'teach' Excel some simple chess principles (capture the other pieces, move your pieces to good squares), and get Excel to recommend a move to make?
We currently have a chess board, but no pieces! In the fourth video in the series, we explore how to create the 'pieces', and position them accurately. It would be possible to do this 'manually' using shapes and dragging them around the board; but, it would be better to automate this process with a 'reset' button, to set the pieces up for a new game.
What coding techniques are required to get this job done? Chess comprises 32 pieces in total, so we'll use a loop, combined with a table in the spreadsheet, to repeat the 'positioning' process while changing important details for each piece. Some Tiger favourites are on show here including the offset command, integer variables. We'll also create a 'backend' sheet to hold information that the user does not need to see.
What do you think about the Spreadsheet Skunkworks series? Do you have any ideas for Chris? Don't forget to leave a comment.
Get in touch with Tiger using the platforms below!
For regular spreadsheet hints and tips and more on the #ExcelRevolution:
Комментарии