Skip to content

Commit

Permalink
Sync bob (exercism#806)
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
tomasnorre authored Sep 24, 2024
1 parent 172d5c0 commit 93f6ca2
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 107 deletions.
27 changes: 15 additions & 12 deletions exercises/practice/bob/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Instructions

Bob is a lackadaisical teenager. In conversation, his responses are very limited.
Your task is to determine what Bob will reply to someone when they say something to him or ask him a question.

Bob answers 'Sure.' if you ask him a question, such as "How are you?".
Bob only ever answers one of five things:

He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals).

He answers 'Calm down, I know what I'm doing!' if you yell a question at him.

He says 'Fine. Be that way!' if you address him without actually saying
anything.

He answers 'Whatever.' to anything else.

Bob's conversational partner is a purist when it comes to written communication and always follows normal rules regarding sentence punctuation in English.
- **"Sure."**
This is his response if you ask him a question, such as "How are you?"
The convention used for questions is that it ends with a question mark.
- **"Whoa, chill out!"**
This is his answer if you YELL AT HIM.
The convention used for yelling is ALL CAPITAL LETTERS.
- **"Calm down, I know what I'm doing!"**
This is what he says if you yell a question at him.
- **"Fine. Be that way!"**
This is how he responds to silence.
The convention used for silence is nothing, or various combinations of whitespace characters.
- **"Whatever."**
This is what he answers to anything else.
10 changes: 10 additions & 0 deletions exercises/practice/bob/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Introduction

Bob is a [lackadaisical][] teenager.
He likes to think that he's very cool.
And he definitely doesn't get excited about things.
That wouldn't be cool.

When people talk to him, his responses are pretty limited.

[lackadaisical]: https://www.collinsdictionary.com/dictionary/english/lackadaisical
22 changes: 0 additions & 22 deletions exercises/practice/bob/.meta/example.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
<?php

/*
* By adding type hints and enabling strict type checking, code can become
* easier to read, self-documenting and reduce the number of potential bugs.
* By default, type declarations are non-strict, which means they will attempt
* to change the original type to match the type specified by the
* type-declaration.
*
* In other words, if you pass a string to a function requiring a float,
* it will attempt to convert the string value to a float.
*
* To enable strict mode, a single declare directive must be placed at the top
* of the file.
* This means that the strictness of typing is configured on a per-file basis.
* This directive not only affects the type declarations of parameters, but also
* a function's return type.
*
* For more info review the Concept on strict type checking in the PHP track
* <link>.
*
* To disable strict typing, comment out the directive below.
*/

declare(strict_types=1);

class Bob
Expand Down
Loading

0 comments on commit 93f6ca2

Please sign in to comment.