Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Hangman
#include <iostream> #include <string.h> const int MAXLEN=256; class Model { char word[MAXLEN]; char chosen[MAXLEN]; int wrong, right; char disp[MAXLEN]; public: int restart(char* word) { strcpy(this.word,word); wrong=0; right=0; for(int i=0;word[i];i++){ disp[i]='_'; disp[i+1]=0; } *chosen=0; return 0; } int guess(char c, int from=0) { char*f; int k; if(f=strchr(word+from,c)) { k=f-word; right++; return guess(c,k+1)+1; } else return 0; } Model(int wordlen, int maxguesses) int main() { std::cout << "Hello, world!\n"; }
run
|
edit
|
history
|
help
0
zero size std::array parameter
CIS-2207 Week1 Assignment1 Company Devisions
codecvt wide string conversion with multibyte chars and locale + concatenation
CT1
Full System Specifications version 2
Error defining lambda inside namespace
parameter pack workaround
masodijegy.cpp
#8
class with unique_ptr to vector