int main() { int num,oldnum; char ch = 0; char *buf = NULL; buf = (char *)malloc(sizeof(char)*4); // get_charnumber(num,4,buf); // printf("%s\n",buf); while(1) { do { // sleep(1); oldnum = num; srand((uint)time(NULL)); num = rand(); }while(num < 1000); get_charnumber(num,4,buf); printf(">>>>>欢迎进行猜字游戏<<<<<\n"); printf("-----按1 进入游戏\n"); printf("-----按2 查看规则\n"); printf("-----按0 退出游戏\n"); ch = mygetch(); switch(ch) { case '1': { start_game(buf,4); break; } case '2': { show_rule(); break; } case '0': goto exit; } } exit: free(buf); return 0; }
void tex::show_node_list(ptr p) { int n; if (cur_length() > depth_threshold) { if (p > null) print(" []"); return; } n = 0; while (p > null) { print_ln(); print_str(); incr(n); if (n > breadth_max) { print("etc."); return; } if (is_char_node(p)) { print_font_and_char(p); } else { switch (type(p)) { case HLIST_NODE: case VLIST_NODE: case UNSET_NODE: show_box1(p); break; case RULE_NODE: show_rule(p); break; case INS_NODE: show_insertion(p); break; case WHATSIT_NODE: show_whatsit(p); break; case GLUE_NODE: show_glue(p); break; case KERN_NODE: show_kern(p); break; case MATH_NODE: show_math(p); break; case LIGATURE_NODE: show_ligature(p); break; case PENALTY_NODE: show_penalty(p); break; case DISC_NODE: show_discretionary(p); break; case MARK_NODE: show_mark(p); break; case ADJUST_NODE: show_adjust(p); break; case STYLE_NODE: print_style(subtype(p)); break; case CHOICE_NODE: show_choice_node(p); break; case INNER_NOAD: case ORD_NOAD: case OP_NOAD: case BIN_NOAD: case REL_NOAD: case OPEN_NOAD: case CLOSE_NOAD: case PUNCT_NOAD: case RADICAL_NOAD: case OVER_NOAD: case UNDER_NOAD: case VCENTER_NOAD: case ACCENT_NOAD: case LEFT_NOAD: case RIGHT_NOAD: show_normal_noad(p); break; case FRACTION_NOAD: show_fraction_noad(p); break; default: print("Unknown node type!"); break; } } p = link(p); } }