Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- OBJ
- text : "vga_text"
- VAR
- long Hunger
- long Poo
- long Sleep
- long Eat
- long Exp
- long Age 'formerly function
- long State
- long ResponseState
- long Button [32]
- long Funct
- Pub Main
- Initialize
- Repeat
- If Exp =< 10
- Age := @VY
- If Exp > 10 and Exp =< 20
- Age := @Y
- If Exp > 30
- Age := @A
- Display
- Hunger += 2
- Poo += 3
- Sleep += 1
- If Hunger =< 15
- State := 1
- Else
- State := 3
- ActionPub
- If Poo =< 10
- State := 1
- Else
- State := 5
- ActionPub
- If Sleep =< 20
- State := 1
- Else
- State := 7
- ActionPub
- PUB Initialize
- text.start(8)
- text.out(00)
- cognew(ButtonPub, @Button)
- Hunger := 0 '0 is not hungry 100 is hungry
- Poo := 0 '0 is no need to poo 100 is needs to
- Sleep := 0 '0 is not sleepy 100 is sleepy
- Exp := 0
- Pub ActionPub
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Age + ((State - 1) * 9))
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,7))
- text.str(Age + (State * 9))
- waitcnt(clkfreq + cnt)
- Pub Display
- text.out(1)
- text.dec(Hunger)
- text.out(13)
- text.dec(Poo)
- text.out(13)
- text.dec(Sleep)
- text.out(13)
- text.dec(Exp)
- text.out(13)
- Pub ButtonPub | ButtonPush
- dira[0..4]~
- repeat
- ButtonPush := ina[0..4]
- case ButtonPush
- %11110:
- Funct := @Zero 'hunger
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- ResponseState := 9
- ResponsePub
- Hunger := 0
- Exp += 5
- %11101:
- Funct := @One 'poo
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- ResponseState := 5
- ResponsePub
- Poo := 0
- Exp += 5
- %11011:
- Funct := @Two
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- NonPub
- %10111:
- Funct := @Three
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- ResponseState := 7
- ResponsePub
- Sleep := 0
- Exp += 5
- %01111:
- Funct := @Four
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- NonPub
- Pub WaitPub
- repeat
- until ina[2] == 0
- text.str(Funct + 21)
- return
- Pub ResponsePub
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Age + ((ResponseState - 1) * 9))
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Age + (ResponseState * 9))
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub NonPub 'never mind
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(string("Never Mind!"))
- waitcnt(clkfreq + cnt)
- text.out(00)
- DAT
- VY byte ".ô ", 0
- VYStandby2 byte " Ô. ", 0
- VYHungry byte ".ö ", 0
- VYHungry2 byte " Ö. ", 0
- VYPooing byte "..õ ", 0
- VYPooing2 byte "õ.. ", 0
- VYSleeping byte "ó zz ", 0
- VYSleeping2 byte " ò zZ ", 0
- VYEating1 byte " ö. ", 0
- VYEating2 byte " ö ", 0
- Y byte " ^.^ ", 0
- YStandby2 byte "^.^ ", 0
- YHungry byte " 'o' ", 0
- YHungry2 byte "'.' ", 0
- YPooing byte " >.< ", 0
- YPooing2 byte "-.< ", 0
- YSleeping byte " ~o~ zz ", 0
- YSleeping2 byte "~.~ zzZ ", 0
- YEating1 byte " ^o^ o ", 0
- YEating2 byte " ^~^ ", 0
- A byte " >(^.^)>", 0
- AStandby2 byte "<(^.^)< ", 0
- AHungry byte " ('o') ", 0
- AHungry2 byte "('.') ", 0
- APooing byte " (>.<) ", 0
- APooing2 byte "(-.<) ", 0
- ASleeping byte " (~o~)zz", 0
- ASleeping2 byte "(~.~)zzZ", 0
- AEating1 byte "(^o^)nom", 0
- AEating2 byte "(^~^)NOM", 0
- Zero byte "Feed Me? ", 0 'down
- Zero2 byte "I have been fed! ", 0
- One byte "Clean Me? ", 0 'left
- One2 byte "I have been cleaned!", 0
- Two byte "Never mind! ", 0 'center
- Two2 byte "Never mind! ", 0
- Three byte "Should I sleep? ", 0 'right
- Three2 byte "I have slept! ", 0
- Four byte "Never mind! ", 0 'up
- Four2 byte "Never mind! ", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement