Skip to content

Add Fizz Buzz in Chapel#4336

Merged
rzuckerm merged 4 commits intoTheRenegadeCoder:mainfrom
Kaamkiya:chapel-fizzbuzz
Jan 19, 2025
Merged

Add Fizz Buzz in Chapel#4336
rzuckerm merged 4 commits intoTheRenegadeCoder:mainfrom
Kaamkiya:chapel-fizzbuzz

Conversation

@Kaamkiya
Copy link
Copy Markdown
Member

I Am Adding a New Code Snippet in an Existing Language

@rzuckerm rzuckerm added enhancement Any code that improves the repo fizz buzz See: https://sampleprograms.io/projects/fizz-buzz/ labels Jan 19, 2025
Copy link
Copy Markdown
Collaborator

@rzuckerm rzuckerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't know what's wrong here, but it looks like Fizz is being output instead of 1. See this error

@Kaamkiya
Copy link
Copy Markdown
Member Author

I don't really understand it either. I'll have to look into it.

@rzuckerm
Copy link
Copy Markdown
Collaborator

@Kaamkiya I'm wondering if the version of Chapel is too old to run your sample properly. You could try updated the tag in testinfo.yml to 2.3.0. Since this is a major revision, it may break other samples.

@rzuckerm
Copy link
Copy Markdown
Collaborator

I tried it out locally, and it looks like all of the existing Chapel samples run in 2.3.0. I also took a look at my Baklava sample, and I used for instead of forall, and I used braces instead of do. I don't know enough about Chapel to know if this would make a difference

@Kaamkiya
Copy link
Copy Markdown
Member Author

I'm trying updating testinfo.yml and if that fails I'll look into your suggestions.

@Kaamkiya
Copy link
Copy Markdown
Member Author

I'm very confused here, because it works in the online compiler, but not here.

@rzuckerm
Copy link
Copy Markdown
Collaborator

I'm very confused here, because it works in the online compiler, but not here.

I tried your sample locally, and it looks like forall outputs values in somewhat random order:

Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
...

If I change forall to for, it seems to work. I think this explains why that is happening.

@rzuckerm rzuckerm mentioned this pull request Jan 19, 2025
2 tasks
@Kaamkiya
Copy link
Copy Markdown
Member Author

Well, thank you! You were right.

Copy link
Copy Markdown
Collaborator

@rzuckerm rzuckerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, @Kaamkiya ! Thanks for your contribution

@rzuckerm rzuckerm merged commit 5b7e420 into TheRenegadeCoder:main Jan 19, 2025
@Kaamkiya Kaamkiya deleted the chapel-fizzbuzz branch January 19, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Any code that improves the repo fizz buzz See: https://sampleprograms.io/projects/fizz-buzz/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Fizz Buzz in Chapel

2 participants