GC8HR7R Unknown Cache Programming Challenge #1
Type: Mystery | Size: Regular Regular | Difficulty: 4.5 out of 5 | Terrain: 2.5 out of 5
By: SpyGuy1 @ | Hide Date: 01/07/2020 | Status: Available
Country: United States | State: Colorado
Coordinates: N39° 38.700 W105° 10.600 | Last updated: 06/19/2022 | Fav points: 0
Dogs  Recommended for kids  Not Wheelchair accessible  Short hike (less than 1km) 

The cache is not at the coordinates posted above. To find the cache, find the correct puzzle solution and enter it at the geochecker here. The geochecker will give you the cache coordinates and more information about finding it, if you enter the proper solution. The solution is in the format: #,#,#,#,#  where # represents a whole number. The code below may encounter an error if you try a solution that is not in this format.

 

To find the solution to this puzzle you will need to know/learn a little bit about the C++ programming language. There are many helpful online resources for C++. One easy way to run the code below is by using an "Online C++ Compiler". After running the code, you will need to figure out what you need to type into the prompt for it to print out: "Good job, you found the solution!". You can find this correct solution by studying the code.

You will need to understand the basics of arrays, for loops, if/else statements, boolean operators, and modulus. This code was written in C++11 but should work in C++17 as well.

 

There is a short 1/2 mile walk from a free parking lot in order to find the final cache. It has plenty of room for trading items and trackables. The original contents includes a logbook, small toys, and a few of my newly made custom signature items. Please make sure to secure the lid properly and cover up the container when you are done!

 

FTF: geysers123

 

Good luck! If you need help, feel free to send me a message.

 

Here is the code you will need to look at:

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
  string userInput;
  cout << "Enter your solution as a comma separated list of 5 numbers, then press ENTER: ";
  cin >> userInput; //your input is stored in this string variable "userInput"

  int myArray[5]; //an array that can store 5 integers called "myArray"
  stringstream ss(userInput); //used with getline to separate out the numbers you inputted
  string newNumber;
  for(int j = 0; j < 5; j++)
  {
    getline(ss,newNumber,','); //stores the next part of your input string (separated by a comma) into "newNumber"
    myArray[j] = stoi(newNumber); //stoi converts strings to integers
  }

  bool valid = true; //if this variable is ever set to false, the incorrect solution was used
  int current;
  int previous;

  //this loop helps to check if your solution is correct
  for(int j = 0; j < 5; j++)
  {
    current = myArray[j];
    if(j == 0)
    {
      if(!(current > 0 && current < 10))
      {
        valid = false;
      }
    }
    else
    {
      if(!(current % 5 == 0 && previous * 2 == current))
      {
        valid = false;
      }
    }
    previous = current; //the "previous" variable stores the last number that was visited in the array
  }

  if(valid)
  {
    cout << "Good job, you found the solution!" << endl << "Enter this same solution into the geochecker that is linked on the cache page to reveal the cache coordinates." << endl;
  }
  else
  {
    cout << "Incorrect solution, please try again!" << endl;
  }
}

 


You can validate your puzzle solution with certitude.

Additional Waypoints

 Custom URLs

Add cache to watch list
Log your visit
Picture Gallery

 Hints

Use Google to your advantage. For example you can search: "C++ for loops". You can also use a "cout" print statement to help check the value of different variables.
[Send me a message if you need additional help!]

 Nearby Caches

GCAJ5KT Shocking!! Part 1 (16.79 kms N)
GCAJ5M4 Shocking part 2 (16.98 kms N)
GC5JYHB Triangle Park (17.10 kms E)
GC5JYH0 Mushroom Park (18.04 kms E)
GC2M5GV Italian or Chocolate?? (19.33 kms NE)

   


Driving Directions

 Logs

5 Logs: Found it 4  Didn't find it 1  

Found it 04/07/2020 By die4Kas
Thanks! Found it with the kids today!

Found it 04/06/2020 By TwoPonds
Enjoyed the puzzle. Took a couple times to find it. My GPS said I was 49ft away when I found it. Thanks to SpyGuy for the timely help. Lovely spot.

Found it 03/25/2020 By COpackrat
This took me longer than it should have when I tried to solve it, as I made a bad assumption when looking at the code. D'uh! Glad when the light came on and made sense. Thanks for the fun puzzle and cache!

Didn't find it 03/04/2020 By sleuthers
I enjoyed the puzzle which was a quick solve for me. However, I spent almost an hour looking for the cache today but with no joy. Hopefully it's still there...

Found it 01/21/2020 By WanderingChickadee
While I'm not a C++ programmer and have been retired for over 10 years from being a programmer the code was pretty easy to understand.

Nice hide and nice camo! Cache and log is in great shape.

TNLN-SL!

TFTC!!!