Skip to content

Instantly share code, notes, and snippets.

@motoishmz
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motoishmz/ac420dc71d4610403dea to your computer and use it in GitHub Desktop.
Save motoishmz/ac420dc71d4610403dea to your computer and use it in GitHub Desktop.
#include "ofMain.h"
class ofApp : public ofBaseApp
{
const int limit = 100;
const int num_col = 10;
const int col_size = 25;
public:
bool isNabeatsu(int number)
{
return (number % 3 == 0) || (ofToString(number).find("3") != string::npos);
}
void draw()
{
ofTranslate(50, 50); // 適当に移動
for (int i=0; i<limit; i++)
{
ofPoint position;
position.x = i % num_col * col_size;
position.y = i / num_col * col_size;
ofColor font_color = isNabeatsu(i) ? ofColor::red : ofColor::white;
ofSetColor(font_color);
ofDrawBitmapString(ofToString(i), position);
}
}
};
#pragma mark -
#pragma mark main
int main(){
ofSetupOpenGL(500, 500, OF_WINDOW);
ofRunApp(new ofApp());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment