コード例 #1
0
ファイル: WordGame.c プロジェクト: kimtu/Projects
void play_word_game(void) {
	char word_list[TOTAL_COUNT][MAX_WORD] = {""};
	char read_word[MAX_WORD] = "";
	char working_word[MAX_WORD] = ""; 
	char c;
	int word_count;
	int score = 0;
	int win_score;
	int find_flag;

	srand( (unsigned int) time(NULL));
	printf("time...%d\n", (unsigned int)time(NULL));

	word_count = read_word_list("wordlist.txt", word_list);

	while(1) {
		printf("Current Score is : %d \n", score);
		printf("Figure it out!!!...\n");

		get_new_word(word_list, word_count, read_word);

		init_working_word(read_word, working_word);

		win_score = 100;

		while(1) {
			display_word(working_word);
			
			c = getch();
			if(c==ESC) {
				return;
			}
			printf("%c\n", c);

			find_flag = find_word(c, read_word, working_word);

			if (is_word_complete(read_word, working_word)) {
				display_word(working_word);
				printf("Success !!! \n\n");
				score += win_score;
				break;
			}

			if (find_flag == FALSE && win_score-5>=0) {
				win_score -=5;
			}
		}

		
	}
}
コード例 #2
0
ファイル: example_timer.c プロジェクト: Mayeu/OS-Project-SSIK
    {
      
while (!tty->lsr.field.thre);
      
tty->thr = '\r';
    
}
    
i++;
  
}

}


/* kinit:
 *   Application-specific initialisation code, called
 *   from the boot code '_start' in 'asm.S'.
 */ 
  void
kinit() 
{
  
char           a[] =
    { 'H', 'i', ' ', 'd', 'u', 'd', 'e', ',', ' ', 
'w', 'h', 'a', 't', '\'',
    's', ' ', 'u', 'p', '?', '\n', '\0'
  };
  
    /* Set UART word length ('3' meaning 8 bits).
     * Do this early to enable debug printouts (e.g. kdebug_print).
コード例 #3
0
ファイル: main.c プロジェクト: fujii/myd-3.4-plus
void display(MYD myd, int index, int n_match, int scroll) {
    int i;
    int x, y;

    term_clear();
    print_prompt(edit.text, edit.cursor);

    term_move(0, 1);
    x = 0;
    y = 1;

    i = scroll;

    while(i < n_match) {
        /*  単語の表示  */
        display_word(myd_key(myd, index+i), &x, &y);

        if(y >= term_height - 1)
            break;

        /* 意味の表示  */
        display_mean(myd_text(myd, index+i), &x, &y);

        i ++;

        if(y >= term_height - 1)
            break;
    }

    print_status(myd, n_match);
}
コード例 #4
0
ファイル: example_syscall.c プロジェクト: fjxokt/OS-Project
/* Kernels internal definition of my system call (prefix 'k'). */
void
kmy_system_call(uint32_t v)
{

    /* Implementation of my_system_call: */
    /* Displays value of its argument.   */
    display_word(v);
}
コード例 #5
0
ファイル: example_timer.c プロジェクト: Mayeu/OS-Project-SSIK
    /* example of call to a print function */ 
    printstr(a);
  
    /* Put '0' on the Malta display. */ 
    display_word(0);
  
    /* Setup storage-area for saving registers on exception. */ 
    kset_registers(&regs);
  
    /* Initialise timer to interrupt in 100 ms (simulated time). */ 
    kload_timer(100 * timer_msec);
  
    /* Update the status register to enable timer interrupts. */ 
    kset_sr(0xFFBF00E8, 0x10008001);
  
    /* Forever do nothing. */ 
    while (1);

}
コード例 #6
0
ファイル: display.c プロジェクト: Jacob1988/b3603
void display_refresh(void)
{
	int i = display_idx++;
	uint8_t bit = 8+(i*2);
	uint16_t digit = 0xFF00 ^ (3<<bit);

	if (timer > 0)
		timer--;
	if (pending_update && timer == 0) {
		memcpy(display_data, pending_display_data, sizeof(display_data));
		pending_update = 0;
		timer = 1500; // 1/2 of a second, approximately
	}

	display_word(digit | display_data[i]);

	if (display_idx == 4)
		display_idx = 0;
}
コード例 #7
0
ファイル: main.cpp プロジェクト: OnlyJeje/Securite
int	main(int ac, char **av)
{
   std::list<std::string> list_word;
   std::list<std::string> list_md5;  
   std::list<std::string> list_to_crack;

   int	i = 0;
   getList(list_word, list_md5);
   getListfromFile("md5-to-crack.txt", list_to_crack);
   for (auto elem_list : list_md5)
     {
       for (auto el : list_to_crack)
	 if (elem_list == el)
	   {
	     std::cout << el << " -> ";
	     display_word(list_word, i);
	   }
       i++;
     }
}