Shortening large chunks of code
Yes you can, and the solution is very simple. It's in two parts, and they make up part of the absolute fundamental building blocks not just in C, but in almost any programming language.

You can read good information on arrays here, and 'for loops' here (it's about half way down the page). Without wishing to offend, it seems like you are missing some really basic concepts and I recommend starting at the beginning of the tutorial series that the two aforementioned links are part of.

I'll just cover the basics. If you don't understand anything, refer to the tutorials. If you still don't understand then please comment, but make sure you can convince us that you've really given it a good go. We're here to help as long as you're here to learn.

To declare an array of N variables, all of which are the same type, you use:

&lt;type&gt; &lt;name_of_variable&gt; [&lt;number_of_elements&gt;];

or:

long turns[15];


Now you have an array of 15 longs. Ta da!

You now have to set the values of each turn. As your values are all the same (if you ignore the fact that random() ultimately leaves you with different values) you can use a for loop:

for (int x=0; x&lt;15; x++)
{
    turns[x] = random(sizeof(turns) / sizeof(char*));
}


I won't explain how a for loop works; I gave you a link to the tutorial to save me writing it all out myself.

That covers shrinking of part 1 and 2. Part 3 requires a little more thought. That said, as you didn't complete your if statement, I don't actually know what you plan to do if any two adjacent turn elements are the same. I shall assume that you would 're-randomise' one of the duplicates. For this you can again use a for loop, starting at the beginning and running to N-1 th element, where N is the total number of elements:

for (int x=0; x&lt;14; x++)
{
    if (turns[x] == turns[x+1])
    {
        turns[x+1] = random(sizeof(turns) / sizeof(char*));
    }
}


You need make sure that turns[x+1] is not outside of the array, which is why the for loop runs for one iteration less than there are elements.

The fourth shrinkable part is just a matter of swtiching multiple print statements into single for loops:

for (int x=0; x&lt;NUMBER_OF_PRINTS_IN_1st_BUNCH; x++)
    lcd.print(turns[x]);
lcd.setcursor(0,2);
for (int x=WHERE_YOU_LEFT_OFF; x&lt;NUMBER_OF_PRINTS_IN_2nd_BUNCH; x++)
    lcd.print(turns[x]);
lcd.setcursor(0,3);
for (int x=WHERE_YOU_LEFT_OFF_AGAIN; x&lt;NUMBER_OF_REMAINING_PRINTS; x++)
    lcd.print(turns[x]);


All done.