You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
559 B

## stars
### Instructions
Create a function named `stars` that takes a `u32` as an argument and returns a `String` of stars (asterisks). The number of stars returned is 2^n (2 to the nth power).
### Expected functions
```rust
3 years ago
pub fn stars(n: u32) -> String {
}
```
### Usage
Here is a program to test your function.
```rust
use stars::stars;
fn main() {
println!("{}", stars(1));
println!("{}", stars(4));
println!("{}", stars(5));
}
```
3 years ago
And its output:
```console
$ cargo run
**
****************
********************************
$
```