Talk:Caesar cipher: Difference between revisions

(Correction of C solution - 2019-03-04)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
== draft task ==
 
Draft task because I have not yet posted a solution. --[[User:Kernigh|Kernigh]] 00:51, 12 June 2011 (UTC)
:When you create a task you don't have to explain why it's a draft. All tasks should be drafts when they start out. --[[User:Mwn3d|Mwn3d]] 00:54, 12 June 2011 (UTC)
 
 
== more specifications? ==
Line 22 ⟶ 25:
 
:Compilation of the original program was carried out on Linux, where the implicit function declaration warnings for isalpha, isupper and tolower, are resolved by adding an #include <ctype.h> statement at the top. However, the program crashes at run-time causing a segmentation fault at the point of transforming the first char in the string. The reason for the failure is because the isupper function is only guaranteed to return zero if it fails, and a non-zero value if it passes. On linux this non-zero value is not '1' as the original author may have expected, but '255' (checked the result by using gdb); as such it breaks the idea of using the result of isupper in this fashion to determine which alphabet string (lower or upper) to use as there's only index '0' and '1' in the 'alpha' const char array named 'alpha[2]' and no there's no index at '255' (reason for the seg fault!). This is resolved by using an if statement to test the case of current alpha character and to set the index of 'alpha' array to 0 or 1 accordingly.
 
==Haskell last version (Risk of copyright violation ?)==
The last added Haskell variant is a nice piece of code, and its provenance is cited, but it appears to be a verbatim copy from a work by Graham Hutton.
 
My understanding of https://rosettacode.org/wiki/Rosetta_Code:Copyrights is that verbatim copying is discouraged, and may be legally unsound. I wonder whether there is any basis for guaranteeing that there is a right to reproduce that code here ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 20:56, 30 June 2020 (UTC)
 
No response after one year – deleted now for lack of reassurances on copyright violation. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:38, 15 September 2021 (UTC)
9,655

edits