abap
abap copied to clipboard
implement exercise: Difference of squares
closes: #236
@larshp - do you think it's a bug? a down porting issue? The below code works:
data num type i.
data num_x type i.
num = 5.
num_x = ( ( num * ( num + 1 ) ) / 2 ).
write ipow( base = num_x exp = 2 ).

But this doesn't => output 1.
data num type i.
num = 5.
write ipow( base = ( ( num * ( num + 1 ) ) / 2 ) exp = 2 ).

We want to keep the repo compatible with abapGit. I'm not sure how you are editing the files but your editor is not following the rules set by .editorconfig. Source files .abap need an empty line at the end of the file. .xml files also need an empty line at the end and a UTF-8 BOM (0xEF,0xBB,0xBF) at the beginning of the file (note: it's not visible in GitHub). The easiest is to copy an existing .xml from the repo and adjust accordingly (or create the objects in an ABAP system and use abapGit to push them to the repo).
@mbtools - thanks for pointing this out, I learned something new. is there a way for me to verify that I am complying with the .editorconfig rule so I know that I haven't messed up anything while making manual addition/changes on GitHub? I have used vscode online(github.dev) editor to reverify files of this PR while resolving conflict.
The files are not correct yet. You can see in https://github.com/exercism/abap/pull/242/files how I corrected some of the other files. The end-of-file is easy to add. For the BOM value, copy older XMLs for example from https://github.com/exercism/abap/tree/main/exercises/practice/hello-world.
As far as I know, VScode does not use the .editorconfig in the repo automatically. Try it with extension https://github.com/editorconfig/editorconfig-vscode.
The files are not correct yet. You can see in https://github.com/exercism/abap/pull/242/files how I corrected some of the other files. The end-of-file is easy to add. For the BOM value, copy older XMLs for example from https://github.com/exercism/abap/tree/main/exercises/practice/hello-world.
As far as I know, VScode does not use the
.editorconfigin the repo automatically. Try it with extension https://github.com/editorconfig/editorconfig-vscode.
Thank you, this helps a lot.
@mbtools @larshp - Please review and provide feedback.
Please rename the folder from difference-of-squares to difference-of-squar to avoid this error in abapGit:

Otherwise it looks good
"difference-of-squares" is the correct name of the exercise...
Who cares about a folder name? :-)
configlet will give an error if the slug and folder does not match, https://github.com/exercism/abap/actions/runs/3410469426/jobs/5673465648
the icon is determined via the slug name
@mbtools @larshp: do we want to ditch the exercise and any other with names larger than 20 characters( $EXERCISM_ being 10 )? if yes, then it will make sense to add to contribution guidelines.
well, I think we need to find a solution that works for both contributors and students wanting to pull exercises via abapGit
this repository can have the default Exercism structure, and then possibly have an automatic clone possibly without the deep folder structure
@Dwivedirahul44 check conflicts
@Dwivedirahul44 check conflicts
@larshp - apologies for missing the merge conflict. Do we want to hold off on this exercise till we have a workaround/solution for 30 character limit of package names? or push this ahead? I will delete the PR if we decide to hold.
merge