Skip to content

learning about interactive programming with calva

Notifications You must be signed in to change notification settings

AlbertSnows/hotshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solving Hotshot

Repo to solve the hotshot problem per the request of the assessment.

Written in clojurescript.

Building

This project is built using the shadow-cljs framework.

Our application targets node. It's a simple CLI interface.

To build, make sure you have shadow-cljs and all other relevant packages (node, npm, etc.) installed via npx.

Then you can build a node script with the following command

npx shadow-cljs release app

or just

shadow-cljs release app

if you have shadow-cljs installed globally.

The production release targets the node file /public/out/get-hotshot-score.js.

Refer to shadow-cljs.edn for more information about how this repo is bulit.

Any hotshot data you want to test can be passed into this script. You can run it using the command

node .\public\out\get-hotshot-score.js <input>

An example use case is provided below.

hotshot> node .\public\out\get-hotshot-score.js "{'body':
    [{
         'made_shots': ['green1', 'gray2', 'red2'],
         'attempted_shots': ['green1', 'gray2', 'blue2', 'red2']
     }, {
         'made_shots': ['green1', 'yellow1', 'gray2', 'blue1'],
         'attempted_shots': ['green1', 'yellow1', 'gray2', 'blue1', 'red2']
     }, {
         'made_shots': ['green1', 'yellow1', 'blue2', 'red1', 'blue2', 'gray2', 'gray1', 'red2', 'blue1'],      
         'attempted_shots':  ['green1', 'yellow1', 'blue2', 'red1', 'blue2', 'gray2', 'gray1', 'red2', 'blue1'],
         'goat_shots': ['green1', 'yellow1', 'gray2']
     }, {
         'made_shots': ['green1', 'yellow1', 'blue2', 'red2'],
         'attempted_shots': ['green1', 'yellow1', 'blue2', 'red2']
     }, {
         'made_shots': ['green1', 'yellow1'],
         'attempted_shots': ['green1', 'yellow1', 'gray2', 'blue2', 'red2']
     }, {
         'made_shots': ['red2', 'green1', 'blue1', 'red2', 'red1'],
         'attempted_shots': [ 'red2', 'green1', 'blue1', 'red2' ,'red1', 'green1']
     }, {
         'made_shots': ['green1', 'yellow1', 'gray2', 'blue1', 'red1'],
         'attempted_shots': ['green1', 'yellow1', 'gray2', 'blue1', 'red1']
     }, {
         'made_shots': ['green1', 'yellow1', 'gray2'],
         'attempted_shots': ['green1', 'yellow1', 'gray2', 'blue1', 'red2']
     }, {
         'made_shots': ['green1', 'yellow1', 'gray2', 'blue2'],
         'attempted_shots': ['green1', 'yellow1', 'gray2', 'blue2']
     }, {
         'made_shots': ['green1', 'yellow1', 'gray1', 'blue2', 'red2'],
         'attempted_shots': ['green1', 'yellow1', 'gray1', 'blue2', 'red2']}]}"
[9 21 56 68 75 75 90 100 114 129]

About

learning about interactive programming with calva

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published