7 kyu
Thinkful - Object Drills: Quarks
2,453 of 3,831Grae-Drake
Description:
Background
You're modelling the interaction between a large number of quarks and have decided to create a Quark
class so you can generate your own quark objects.
Quarks are fundamental particles and the only fundamental particle to experience all four fundamental forces.
Your task
Your Quark
class should allow you to create quarks of any valid color ("red"
, "blue"
, and "green"
) and any valid flavor ('up'
, 'down'
, 'strange'
, 'charm'
, 'top'
, and 'bottom'
).
Every quark has the same baryon_number
(BaryonNumber
in C#
): 1/3.
Every quark should have an .interact()
(.Interact()
in C#
) method that allows any quark to interact with another quark via the strong force. When two quarks interact they exchange colors.
Example
>>> q1 = Quark("red", "up")
>>> q1.color
"red"
>>> q1.flavor
"up"
>>> q2 = Quark("blue", "strange")
>>> q2.color
"blue"
>>> q2.baryon_number
0.3333333333333333
>>> q1.interact(q2)
>>> q1.color
"blue"
>>> q2.color
"red"
Fundamentals
Object-oriented Programming
Similar Kata:
Stats:
Created | Jan 21, 2017 |
Published | Jan 21, 2017 |
Warriors Trained | 5364 |
Total Skips | 69 |
Total Code Submissions | 8681 |
Total Times Completed | 3831 |
Python Completions | 2453 |
JavaScript Completions | 949 |
C# Completions | 425 |
Factor Completions | 7 |
Rust Completions | 81 |
Total Stars | 54 |
% of votes with a positive feedback rating | 90% of 493 |
Total "Very Satisfied" Votes | 412 |
Total "Somewhat Satisfied" Votes | 68 |
Total "Not Satisfied" Votes | 13 |
Total Rank Assessments | 21 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |