I am attempting to scramble a word using a key word that defines the positional shift of each letter(the difference between it and ![041]). If it reaches an end of its letter choices ![041] and ~[176] then it is moved to the other end and continues moving. To make it even more random the direction of the moving switches each turn.
This is my attempt at it and it crashes. I recieve the message "Unhandled exception in Directory.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.".
I rarely play with ascii while programming so I am not sure if this is correct at all or if its one small thing.
Code:
for(n=0;n<sCode.length();n++,t++){
if(sMaster.length()==t){
t=0;
}
if(n % 2==0){
for(w=0;w<sMaster.at(t)-041;w++){
if(sCode.at(n)==176){
sCode.at(n)='!';
}
sCode.at(n)=sCode.at(n)+1;
}
}
else{
for(w=0;w<sMaster.at(t)-041;w++){
if(sCode.at(n)==041){
sCode.at(n)='~';
}
sCode.at(n)=sCode.at(n)-1;
}
}
}
This is my attempt at it and it crashes. I recieve the message "Unhandled exception in Directory.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.".
I rarely play with ascii while programming so I am not sure if this is correct at all or if its one small thing.