Here's a simple game, it shouldn't be too hard to convert into C:
Code:
//
// COIN GAME
//
//for wait command
@include "Expansion"
print "This is a coin game, 21 coins is placed on a table\n"
print "you may pick up one, two or three coins. The player\n"
print "who picks up the last coin loses.\n\n"
//number of coins left
coins = 21
//Set a fancy color
//doesn't work with all operating systems
system("color 18")
repeat
//Print the number of coins on the table
call PrintCoins(coins)
//Get the player's number of coins
print "\n"
repeat
print "How many coins would you like to pick up? (1-3) :"
user = input
//must be valid
until ((coins - user) >= 0) && (user > 0) && (user <= 3)
//Pick up the coins
coins -= user
//Is it a loss?
if coins == 0
begin
system("color 1c")
print "You lose!!"
call wait
end
//"AI"
computer = 4 - user
//Pick up the coins
coins -= computer
//Is it a win?
if coins == 0
begin
print "You win!!"
call wait
end
until coins <= 0
//Exit program
exit
procedure PrintCoins(coins)
repeat
print "O "
until (coins-=1) <= 0
return