SlideShare a Scribd company logo
Cleveland Salesforce Developer Group
Rock, Paper, Scissors game with
Apex Maps
#CLESFDevs
Agenda
● Welcome/Intro
● Achievements
● Today’s Topic: Rock, Paper, Scissors game
with Apex Maps
● Announcements & Upcoming Local Events
Lynda Kane
Co-Leader @labboopanda
Orlando Briceno-Gomez
Co-Leader @orlybg
Achievements
Who has earned a certification or
superbadge in Apr, May, or Jun?
Who has started a new job?
Who is new to the Cleveland Salesforce
Developer Group?
Anything else to share?
Rock, Paper, Scissors game with Apex Maps
Knowledge Gaps
A knowledge gap
is a discrepancy
between what is
known and what
should be known
Example 1:
Lynda the Human GPS
Despite going to
Parmatown Mall
hundreds of times, I still
don’t know how to get
there!
Example 2:
Imaginary Numbers
Knowledge Gap + Imposter Syndrome =
😨 😱 😭 😕 😣 🤢 🤔 😰
My Apex Knowledge Gap
Confession:
If I have to review
code, I try to get away
with ignoring or
skipping over any
code that uses Map.
What I Know:
● Key - Value Pair
● Key is unique
● Often see/used
with triggers
● Common is id
with query
results
What I Want to
Know:
● How to create
● How to get the
data
● Can I actually
use one
successfully?
My Apex Map Learning Plan
● Rock, Paper, Scissors
● Screen flow for user to play the game with Apex Action(s)
● Apex to pick computer’s random weapon choice
● Apex to determine who won
● Apex to determine what action the weapon did to win (cut,
smash, cover)
● Test class
Apex Map
Notes:
● Keys and Values
can by ANY data
type (primitive,
collection, sObject,
user-defined, Apex
built-in)
● If key is a string, it
is case-sensitive
(Rock ≠ rock)
Constructor:
● Map<type, type>()
Methods:
● put(key, value) - add pairs
● get(key) - returns value for specified key
● keySet() - returns a Set of the keys (unique, unordered)
● values() - returns List of all values
● size() - # of pairs
● isEmpty() - check for no pairs
● containsKey(key) - is this key in the map? Boolean
● clear() - remove all pairs
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode
/apex_methods_system_map.htm
Rock, Paper, Scissors
Weapon This Wins Over: This Wins By:
Rock Scissors smashes
Paper Rock covers
Scissors Paper cuts
Map<String, List<String>>
Apex Actions in Flows (aka Surprises)
● Only 1 Method per Class can be invocable
● Parameters passed MUST be a List
● Return MUST be a List
Let’s Code
Code Recap
● Random Weapon Select - Map was overkill, use List
● Make the Weapons Map
● Get what chosen Weapon can beat
● Get how the chosen Weapon wins (action)
● Bring it all together
● Code Coverage
Screen Flow
Screen Flow Recap
● 1st Screen: User selects weapon from picklist
● Apex Action: run the code!
○ Pass in the User’s selection
○ Store the result
● 2nd Screen: Show the result
Lifelong Learning
● Error handling (what if user chose Spatula or Lizard as the
weapon?) (use containsKey(key))
● Use keySet() instead of List to randomly pick computer
weapon choice
● Add images to Flow (visual appeal)
● Improve code coverage
● Documentation
● LWC instead for UI
What about Rock, Paper, Scissors, Lizard, Spock
● How to handle 2 possible weapons that can win over
selection (Map<String,List<String>>)
● How to get the action that wins
(Map<List<String>,String>)
● Modify the Flow for additional choices
Questions/Comments?
Instructions:
Contact:
Email: labboo.gc@gmail.com
Twitter: @labboopanda
LinkedIn: https://www.linkedin.com/in/lynda-kane-71379610/
Trailblazer.me: https://trailblazer.me/id/labboo
Announcements & Upcoming Events
Aug 16-18
Minneapolis
Cleveland
#SalesforceSaturday
Most Saturday mornings 9am
at various locations in Greater
Cleveland
Posted to the Collaboration
Group, LinkedIn, & Twitter.
Join our Community Group in
Trailhead! (Cleveland
#Salesforce Saturday)
Job Seeking or Hiring:
Are you seeking a new position or looking for new
member for your team? Let us know. We can also post in
our Trailblazer Community Group on Trailhead!
Next CLE #SFDevs:
Based on your feedback virtual in July
In Person LWC Learning in July
Rock, Paper, Scissors Game with Apex Maps

More Related Content

Similar to Rock, Paper, Scissors Game with Apex Maps

Cloud accounting software uk
Cloud accounting software ukCloud accounting software uk
Cloud accounting software uk
Arcus Universe Ltd
 
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional   w/ Apache Spark @ Scala Days NYCKeeping the fun in functional   w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
Holden Karau
 
ChefConf 2014 - Kanban will save You! Will it?
ChefConf 2014 - Kanban will save You! Will it?ChefConf 2014 - Kanban will save You! Will it?
ChefConf 2014 - Kanban will save You! Will it?
Marcin Mazurek
 
GDC Talk.pdf
GDC Talk.pdfGDC Talk.pdf
GDC Talk.pdf
Nishant298626
 
Effective testing for spark programs scala bay preview (pre-strata ny 2015)
Effective testing for spark programs scala bay preview (pre-strata ny 2015)Effective testing for spark programs scala bay preview (pre-strata ny 2015)
Effective testing for spark programs scala bay preview (pre-strata ny 2015)
Holden Karau
 
Musings of kaggler
Musings of kagglerMusings of kaggler
Musings of kaggler
Kai Xin Thia
 
Week8
Week8Week8
Week8
Rich Price
 
Algorithms overview
Algorithms overviewAlgorithms overview
Algorithms overview
Deborah Akuoko
 
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Holden Karau
 
Extreme Programming practices for your team
Extreme Programming practices for your teamExtreme Programming practices for your team
Extreme Programming practices for your team
Pawel Lipinski
 
Automatic Image Cropping - A journey from a Master Thesis to Production
Automatic Image Cropping - A journey from a Master Thesis to ProductionAutomatic Image Cropping - A journey from a Master Thesis to Production
Automatic Image Cropping - A journey from a Master Thesis to Production
Alexey Grigorev
 
Leaning on the two Ts
Leaning on the two TsLeaning on the two Ts
Leaning on the two Ts
Mani Sarkar
 
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
Chris Gates
 
Approaches to teaching primary computing
Approaches to teaching primary computingApproaches to teaching primary computing
Approaches to teaching primary computing
JEcomputing
 
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
Jorge Lopez-Malla
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-up
Stripe
 
Effective entrepreneurship for developers
Effective entrepreneurship for developersEffective entrepreneurship for developers
Effective entrepreneurship for developers
Carlos Ble
 
Mastering the game of go with deep neural networks and tree search
Mastering the game of go with deep neural networks and tree searchMastering the game of go with deep neural networks and tree search
Mastering the game of go with deep neural networks and tree search
SanFengChang
 
Variables & Expressions
Variables & ExpressionsVariables & Expressions
Variables & Expressions
Rich Price
 
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
YOPESO
 

Similar to Rock, Paper, Scissors Game with Apex Maps (20)

Cloud accounting software uk
Cloud accounting software ukCloud accounting software uk
Cloud accounting software uk
 
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional   w/ Apache Spark @ Scala Days NYCKeeping the fun in functional   w/ Apache Spark @ Scala Days NYC
Keeping the fun in functional w/ Apache Spark @ Scala Days NYC
 
ChefConf 2014 - Kanban will save You! Will it?
ChefConf 2014 - Kanban will save You! Will it?ChefConf 2014 - Kanban will save You! Will it?
ChefConf 2014 - Kanban will save You! Will it?
 
GDC Talk.pdf
GDC Talk.pdfGDC Talk.pdf
GDC Talk.pdf
 
Effective testing for spark programs scala bay preview (pre-strata ny 2015)
Effective testing for spark programs scala bay preview (pre-strata ny 2015)Effective testing for spark programs scala bay preview (pre-strata ny 2015)
Effective testing for spark programs scala bay preview (pre-strata ny 2015)
 
Musings of kaggler
Musings of kagglerMusings of kaggler
Musings of kaggler
 
Week8
Week8Week8
Week8
 
Algorithms overview
Algorithms overviewAlgorithms overview
Algorithms overview
 
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
Apache spark as a gateway drug to FP concepts taught and broken - Curry On 2018
 
Extreme Programming practices for your team
Extreme Programming practices for your teamExtreme Programming practices for your team
Extreme Programming practices for your team
 
Automatic Image Cropping - A journey from a Master Thesis to Production
Automatic Image Cropping - A journey from a Master Thesis to ProductionAutomatic Image Cropping - A journey from a Master Thesis to Production
Automatic Image Cropping - A journey from a Master Thesis to Production
 
Leaning on the two Ts
Leaning on the two TsLeaning on the two Ts
Leaning on the two Ts
 
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
Adversarial Simulation Nickerson/Gates Wild West Hacking Fest Oct 2017
 
Approaches to teaching primary computing
Approaches to teaching primary computingApproaches to teaching primary computing
Approaches to teaching primary computing
 
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
Geoposicionamiento Big Data o It's bigger on the inside Codemetion Madrid 2018
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-up
 
Effective entrepreneurship for developers
Effective entrepreneurship for developersEffective entrepreneurship for developers
Effective entrepreneurship for developers
 
Mastering the game of go with deep neural networks and tree search
Mastering the game of go with deep neural networks and tree searchMastering the game of go with deep neural networks and tree search
Mastering the game of go with deep neural networks and tree search
 
Variables & Expressions
Variables & ExpressionsVariables & Expressions
Variables & Expressions
 
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
 

More from Lynda Kane

Cleveland Developers: CLI in the C-L-E slide deck
Cleveland Developers: CLI in the C-L-E slide deckCleveland Developers: CLI in the C-L-E slide deck
Cleveland Developers: CLI in the C-L-E slide deck
Lynda Kane
 
Migrate to Flow
Migrate to FlowMigrate to Flow
Migrate to Flow
Lynda Kane
 
Can Orlando dance the Mambo?
Can Orlando dance the Mambo?Can Orlando dance the Mambo?
Can Orlando dance the Mambo?
Lynda Kane
 
CLEDevs All about Tests
CLEDevs All about TestsCLEDevs All about Tests
CLEDevs All about Tests
Lynda Kane
 
Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022
Lynda Kane
 
Salesforce Character Cards.pdf
Salesforce Character Cards.pdfSalesforce Character Cards.pdf
Salesforce Character Cards.pdf
Lynda Kane
 
2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf
Lynda Kane
 
CLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global GatheringCLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global Gathering
Lynda Kane
 

More from Lynda Kane (8)

Cleveland Developers: CLI in the C-L-E slide deck
Cleveland Developers: CLI in the C-L-E slide deckCleveland Developers: CLI in the C-L-E slide deck
Cleveland Developers: CLI in the C-L-E slide deck
 
Migrate to Flow
Migrate to FlowMigrate to Flow
Migrate to Flow
 
Can Orlando dance the Mambo?
Can Orlando dance the Mambo?Can Orlando dance the Mambo?
Can Orlando dance the Mambo?
 
CLEDevs All about Tests
CLEDevs All about TestsCLEDevs All about Tests
CLEDevs All about Tests
 
Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022
 
Salesforce Character Cards.pdf
Salesforce Character Cards.pdfSalesforce Character Cards.pdf
Salesforce Character Cards.pdf
 
2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf
 
CLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global GatheringCLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global Gathering
 

Recently uploaded

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 

Recently uploaded (20)

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 

Rock, Paper, Scissors Game with Apex Maps

  • 1. Cleveland Salesforce Developer Group Rock, Paper, Scissors game with Apex Maps #CLESFDevs
  • 2. Agenda ● Welcome/Intro ● Achievements ● Today’s Topic: Rock, Paper, Scissors game with Apex Maps ● Announcements & Upcoming Local Events
  • 3. Lynda Kane Co-Leader @labboopanda Orlando Briceno-Gomez Co-Leader @orlybg
  • 4. Achievements Who has earned a certification or superbadge in Apr, May, or Jun? Who has started a new job? Who is new to the Cleveland Salesforce Developer Group? Anything else to share?
  • 5. Rock, Paper, Scissors game with Apex Maps
  • 6. Knowledge Gaps A knowledge gap is a discrepancy between what is known and what should be known Example 1: Lynda the Human GPS Despite going to Parmatown Mall hundreds of times, I still don’t know how to get there! Example 2: Imaginary Numbers Knowledge Gap + Imposter Syndrome = 😨 😱 😭 😕 😣 🤢 🤔 😰
  • 7. My Apex Knowledge Gap Confession: If I have to review code, I try to get away with ignoring or skipping over any code that uses Map. What I Know: ● Key - Value Pair ● Key is unique ● Often see/used with triggers ● Common is id with query results What I Want to Know: ● How to create ● How to get the data ● Can I actually use one successfully?
  • 8. My Apex Map Learning Plan ● Rock, Paper, Scissors ● Screen flow for user to play the game with Apex Action(s) ● Apex to pick computer’s random weapon choice ● Apex to determine who won ● Apex to determine what action the weapon did to win (cut, smash, cover) ● Test class
  • 9. Apex Map Notes: ● Keys and Values can by ANY data type (primitive, collection, sObject, user-defined, Apex built-in) ● If key is a string, it is case-sensitive (Rock ≠ rock) Constructor: ● Map<type, type>() Methods: ● put(key, value) - add pairs ● get(key) - returns value for specified key ● keySet() - returns a Set of the keys (unique, unordered) ● values() - returns List of all values ● size() - # of pairs ● isEmpty() - check for no pairs ● containsKey(key) - is this key in the map? Boolean ● clear() - remove all pairs https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode /apex_methods_system_map.htm
  • 10. Rock, Paper, Scissors Weapon This Wins Over: This Wins By: Rock Scissors smashes Paper Rock covers Scissors Paper cuts Map<String, List<String>>
  • 11. Apex Actions in Flows (aka Surprises) ● Only 1 Method per Class can be invocable ● Parameters passed MUST be a List ● Return MUST be a List
  • 13. Code Recap ● Random Weapon Select - Map was overkill, use List ● Make the Weapons Map ● Get what chosen Weapon can beat ● Get how the chosen Weapon wins (action) ● Bring it all together ● Code Coverage
  • 15. Screen Flow Recap ● 1st Screen: User selects weapon from picklist ● Apex Action: run the code! ○ Pass in the User’s selection ○ Store the result ● 2nd Screen: Show the result
  • 16. Lifelong Learning ● Error handling (what if user chose Spatula or Lizard as the weapon?) (use containsKey(key)) ● Use keySet() instead of List to randomly pick computer weapon choice ● Add images to Flow (visual appeal) ● Improve code coverage ● Documentation ● LWC instead for UI
  • 17. What about Rock, Paper, Scissors, Lizard, Spock ● How to handle 2 possible weapons that can win over selection (Map<String,List<String>>) ● How to get the action that wins (Map<List<String>,String>) ● Modify the Flow for additional choices
  • 18. Questions/Comments? Instructions: Contact: Email: labboo.gc@gmail.com Twitter: @labboopanda LinkedIn: https://www.linkedin.com/in/lynda-kane-71379610/ Trailblazer.me: https://trailblazer.me/id/labboo
  • 19. Announcements & Upcoming Events Aug 16-18 Minneapolis Cleveland #SalesforceSaturday Most Saturday mornings 9am at various locations in Greater Cleveland Posted to the Collaboration Group, LinkedIn, & Twitter. Join our Community Group in Trailhead! (Cleveland #Salesforce Saturday) Job Seeking or Hiring: Are you seeking a new position or looking for new member for your team? Let us know. We can also post in our Trailblazer Community Group on Trailhead! Next CLE #SFDevs: Based on your feedback virtual in July In Person LWC Learning in July