hollybabaran / shuffle Goto Github PK
View Code? Open in Web Editor NEWShuffle: An educational programming language for card games. SE2015 Fourth Year Design Project.
Shuffle: An educational programming language for card games. SE2015 Fourth Year Design Project.
for each Card currentCard in currentPlayer.Hand
.
.
.
end
This will be useful for control flow logic
it owns a hand and has an integer ID
if / while / else. Concepts are done but we need generators.
--> BUG: you can create else, elseif blocks without preceding if blocks.
for use with CrazyEights
isLegal: when a player tries to make a turn, have another separately user-defined function to check whether or not the player turn is legal
Chhavi's editors got eaten. Make new ones
Right now we only have "player turn" where the user types exactly what the AI player will do. We need to add constructs 1) to differentiate between human and computer players, at setup and inside PlayerTurn; 2) I/O hooks inside human Player Turn to allow players to perform actions
Users are allowed to specify multiple conflicting CardSets in the setup block as follows:
setup board :
CardSet :
<< ... >>
CardSet :
<< ... >>
end
The editor interface won't complain, but it will fail to compile because "__deck" is declared twice. We should have a nicer way of handling this (Alex says we can use constraints).
Right now we do not support Joker at ALL. It's relevant because Joker doesn't have a suit (though it could theoretically have a colour, eg. red vs black jokers)
we need to be able to reference cards without creating them. Sujen says we can use the variableReference class to create a cardReference concept
setupBoard
winCondition
playerTurn (look at robot kaja "script")
Boolean cardPlayed is False
if cardPlayed equal to False
cardPlayed is True
Just for concepts
Print statements inside the generator so that games have output when they run.
Sample output for the sample program:
A new game begins with 4 players.
Deals cards.
Player 1 Turn: Player 1 plays K:♠ into middle.
Player 2 Turn: Player 2 plays Q:♠ into middle.
<...>
Player 1 Turn: Player 1 plays 6:♦ into middle.
Player 1 wins!
We need to figure out how to package Shuffle inside of intellij, and how to modify the packaged intellij to suit the needs of the user.
Once we figure out how to do this, we need to create a step-by-step process (or build pipeline / makefile etc) to automate it
cardPile.topCard needs to return a reference to a card.
In the future we could look into .bottomCard, .randomCard etc
Make it work
allow users to define their own functions for convenience. Related to Blocks and what blocks are allowed in the main.
maybe as simple as the == operator (but in java?) that allows for direct comparison of cards
CHILD ISSUES: if necessary, add constructs to compare suit and rank
For use with CardSet etc-- like "deal the rest of cardset into the middle facedown deck" for crazy eights.
Currently the workaround is "Move 19" where the number is hardcoded to be 52 - (4*8 + 1) = 19. So this isn't marked in the CrazyEights milestone, because there is a workaround, but it is pretty mandatory in the long term
the textgen is just ".shuffle" but its card collection isn't automatically prepended. A program using the shuffle command won't compile.
here is our gen right now:
CardPile middle = new CardPile();
CardPile bottom = new CardPile();
while (true) {
// Perform Player turn code
CardPileUtil.move(2, <!TextGen not found for 'Shuffle.structure.VariableReference'!>, <!TextGen not found for 'Shuffle.structure.VariableReference'!>);
This should be CardPileUtil.move(2, middle, bottom);
fix this
Right now we do not enforce uniqueness in the cardset. Eg this is a valid program that will compile and run:
setup board :
CardSet :
A : ♠
A : ♠
end
player turn :
<< ... >>
end
win condition :
0 equal to 0
end
IF we want to enforce uniqueness, this is a bug and it needs to be fixed; if we do not, this is a feature that needs to be documented
Instead of having textual output, have graphic output based on swing similar to that of Straights (cs247).
commands in the setupBlock and playerTurn need to be output.
right now all we have is move from location to location
if we want to be able to check properties of a card (its rank/suit) we need to have card variables, card references etc
For:
Card
CardSet
Pile
Hand
Number
Variable
Suit currentSuit is faceUpPile.topCard.suit
Rank currentRank is faceUpPile.topCard.rank
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.