Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed#43
Closed
AviBomb wants to merge 5 commits intorahulkumaran:masterfrom
AviBomb:master
Closed
Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed#43AviBomb wants to merge 5 commits intorahulkumaran:masterfrom AviBomb:master
AviBomb wants to merge 5 commits intorahulkumaran:masterfrom
AviBomb:master
Conversation
sumanthd17
suggested changes
Dec 17, 2018
Contributor
There was a problem hiding this comment.
Code doesn't solve the problem of multiple spacing between variables and values. Only works for the corner cases tested in sudocode4.txt. Please change your approach to solve the problem.
Char initialization works only when written in the tested format. (fails with multiple spaces)
Author
|
Hey Thanks for the inputs have worked on it and sent in a new pr #65 with the updated features |
Author
|
@sumanthd17 have a look at the new pr and test if it works for all cases you had in mind and do share your feedback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bit of added code takes care of the incorrect initialization of a variable
Eg: initialise a= 10
initialise a =10
initialise a = 10
would only create "float a" in the C code but after adding this bit of code you will get the C code as "float a=10" it will complete the initialisation
Also Character Initialisation has also been taken care of in this code. It enables you to initialise character by typing initialise char b= 'c' in sudocode and generates the C code of " char b='c' ". It can also print the character datatype using print b which will generate the C code printf("%c\n",b);
The issue with the print command has also been fixed: Supposing we have a variable called temp in the code and we want to print the word "Temp" and then print the data inside temp now there is feature enabling us to do just that. Now if we enclose temp in “(doublequotes)” it will only print the data in temp and not the variable temp .eg print “temp” will display the text temp and not the data inside variable temp.If the data in temp need to be printed it can be done by print temp. Also yet another similar issue resolved is that when we have two variables a and b in the program and we write in the pseudo-code print a+b instead of writing a+b in the program it writes the string "a+b" which makes it compulsory for us to create a temporary variable increasing both time and space complexity of the code. Both these issues can be sorted easily. Now that has been taken care of by putting the expression in round brackets (). eg print (a+b) will generate now the c code of printf("%f\n",a+b);. Now sample test files sudocode4 and sudocode5 have been added to the testfile folder to validate all the above corrected issues.