Hi guys, I'm currently working on a project for my intro programming class.
I currently have a global struct defined as so:
1 2 3 4 5 6 7
|
struct GeneSequence
{
char nuc1;
char nuc2;
char nuc3;
string aAcid;
};
|
Where nuc1-nuc3 represented a user entered genetic code, ex: AAG, UUU, etc. I also have an array of structs so that users can enter as many sequences as they please.
What I would like to do is add an option where you are able to "mutate" the genetic code by selecting a sequence, remove a letter, and push all of the other letters back 1 space in the struct array. For example:
Original sequence:
list[0].nuc1 = 'A';
list[0].nuc2 = 'U';
list[0].nuc3 = 'A';
list[1].nuc1 = 'G';
list[1].nuc2 = 'G';
list[1].nuc3 = 'G';
I want to delete the value of list[0].nuc3, shift all the values of list[1] back 1, so the end product looks like this:
list[0].nuc1 = 'A';
list[0].nuc2 = 'U';
list[0].nuc3 = 'G';
list[1].nuc1 = 'G';
list[1].nuc2 = 'G';
list[1].nuc3 = '-';
I'm very new with structs and programming in general, I want to know if what I'm proposing is possible, and a step in the right direction if it is. I'd really appreciate any help, thanks a lot :)