Dr. Nim is struck by lightning!

March 21, 2017

 

The last Lab Coat Lesson used the tried and true tools of Apex and Visualforce. Times are changing and Lightning isn't just the future, it's the here and now. This Dr. Nim series of lab coat lessons wouldn't be complete without a Lightning implementation of Dr. Nim. We took advantage of the Lightning Design System to give the game a sleek user interface and Lightning Components to run the entire game client-side. No trips to the server means the Artificially Intelligent opponent will beat you even faster!

 

Here's the redesigned app, with built-in responsiveness so you can play on your phone.

 

 

 

DrNimLightning.html

 

 

 

Here's a little extra styling. This gives the game a little extra breathing room.

 

  

 

Here's the controller

 

 

 

Here's the helper

  

 

The challenge is in the helper. There is a function named doPlayer2Turn that is empty. Convert the algorithm from the last post from Apex to Javascript and add a few more lines and the game will be complete! For bonus points, make the game even prettier by changing out the Os we're using for the coins to an SVG icon from the Lightning Design System of your choosing.



 

Please reload

Recent Posts
Please reload

At CRM Science, we use our Salesforce expertise to transform your enterprise. Partnering with our clients throughout the Salesforce journey, we work with leaders to strategize and optimize business processes, and design and develop solutions across every Salesforce cloud. We empower companies to innovate faster, better engage with customers, and improve bottom lines. 

 

CRM Science is a Salesforce Silver Consulting Partner. Our strategic consulting services were recognized by Salesforce in four consecutive Salesforce Partner Innovation Awards, an annual recognition for partners that deliver outstanding client success. 

Helpful Content
Blog
Events
Client Success
Connect with us
Email Us
860 First Ave, Suite 2
King of Prussia, PA 19406
(484) 775-0333
  • Twitter
  • Facebook
  • YouTube

Copyright © 2011-2020 CRM Science, Inc. All rights reserved.