7 kyu

Can I play right now?

463 of 612nesusvet

Description:

As a strict big brother, I do limit my young brother Vasya on time he spends on computer games. I define a prime-time as a time period till which Vasya have a permission to play computer games. I specify start hour and end hour as pair of integers.

I need a function which will take three numbers - a present moment (current hour), a start hour of allowed time period and an end hour of allowed time period. The function should give answer to a question (as a boolean): "Can Vasya play in specified time?"

If I say that prime-time is from 12 till 15 that means that at 12:00 it's OK to play computer but at 15:00 there should be no more games.

I will allow Vasya to play at least one hour a day.

Date Time
Fundamentals

More By Author:

Check out these other kata created by nesusvet

Stats:

CreatedSep 26, 2017
PublishedSep 26, 2017
Warriors Trained1410
Total Skips26
Total Code Submissions4751
Total Times Completed612
Python Completions463
JavaScript Completions163
Total Stars20
% of votes with a positive feedback rating89% of 123
Total "Very Satisfied" Votes98
Total "Somewhat Satisfied" Votes24
Total "Not Satisfied" Votes1
Total Rank Assessments11
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • nesusvet Avatar
  • JohanWiltink Avatar
  • ZED.CWT Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad