I'm partway through the code of my blackjack app for school, and every time I connect to the companion it does not load the app. It takes a long time to load the first screen and won't load the second screen. Can anyone take a look at this and help me troubleshoot.
ShiresWebbBlackJack_1_copy_copy_copy_copy_copy_copy_copy_copy.aia (545.3 KB)
Probably these, you have @ 8300 blocks on Screen2, this is about the limit for a single screen.
Can't upload the 7.3mb image of the blocks (Discourse errors out) so here is a smaller version:
Learn to use lists and procedures, this will dramatically reduce your block count.
- Reduce your block count:
- Use parametrized procedures for common code
- Use Media text files instead of big clumps of text blocks
- Use generic blocks instead of repeating component event blocks
- Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
- You don't need a component for every data instance. Reuse those components.
- If you can't fit data into a ListView or List Picker, show a small subset of the data in an Arrangement and slide it across the larger list of data.
You have pretty good card image file naming standards:
All your Media files are cards images, except for the card back.
You should be able to load a list of all Media file names at startup, and use it for your card deck manipulation. Use the File component for that, scope = Assets.
(ignore the 2nd and 3rd steps, they are French.)
Check the Lists FAQ for an easy shuffle procedure.
You should also be able to extract card values from each card file name, using the first character.
This would collapse all your logic.
Keep your dealer and player image components in separate global lists, and use the generic (Any) blocks to clear them and drop cards into them.
You will need separate global lists for undealt cards, discarded card, player cards, and dealer cards.
Thank you all very much, I was able to finish it, this is the completed version:
BlackJackFinalCopy.aia (379.5 KB)
A definite improvement over the previous version.
Study up on value procedures to improve it further.


