For Starcraft, it was a *weird* situation where AP Computer Science and regular were being taught in the same classroom... Even though one was C++, and the other was Office. The teacher put us AP students on the back row, with a clear row that he would occasionally come back and lecture from while the other students practiced spreadsheets and such.
After the first couple weeks we were mostly just going through prepared challenges/tutorials on our own. He was so relieved that, as long as we were on schedule, we were allowed to play whatever as long as we kept it a secret from the administration and other students. So we installed Starcraft, which we somehow got working on the LAN. A friend and I also hotseated HoM&M2 a lot.
I didn't really learn the value of object oriented programming until Java at university, but I did well on the AP test. I'm still rubbish at C-family languages.
We only had that class for a quarter, sadly. In another quarter we had network engineering, and the teacher struck us a similar deal except the whole class was in on it. That worked a bit better, because we were getting proper instruction *and* a strong incentive. *ANOTHER* teacher even let us come in during our lunch to play Counterstrike and Team Fortress.
A few years later this was apparently still going on. My younger brother got me into an all-night LAN party and Red Vs Blue marathon... Overseen by an awesome teacher.
My first high school was pretty awesome TBH. Third one had more AP classes but was preppy and unfun (rich area).