Last active
August 29, 2015 14:22
-
-
Save motoishmz/ac420dc71d4610403dea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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