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 Function
- long Button [32]
- long Funct
- Pub Main
- Initialize
- Repeat
- If Exp =< 10
- Function := @VY
- If Exp > 10 and Exp =< 20
- Function := @Y
- If Exp > 30
- Function := @A
- Display
- Hunger += 2
- Poo += 3
- Sleep += 1
- If Hunger =< 15
- StandbyPub
- If Hunger > 15
- HungerPub
- If Poo =< 10
- StandbyPub
- If Poo > 10
- PooPub
- If Sleep =< 20
- StandbyPub
- If Sleep > 20
- SleepPub
- 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 StandbyPub
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,7))
- text.str(Function + 9)
- waitcnt(clkfreq + cnt)
- Return
- Pub HungerPub
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function + 18)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,7))
- text.str(Function + 27)
- waitcnt(clkfreq + cnt)
- Return
- Pub PooPub
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function + 36)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,7))
- text.str(Function + 45)
- waitcnt(clkfreq + cnt)
- Return
- Pub SleepPub
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function + 54)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,7))
- text.str(Function + 63)
- waitcnt(clkfreq + cnt)
- Return
- 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)
- Return
- 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
- HungerResponsePub
- Hunger := 0
- Exp += 5
- %11101:
- Funct := @One 'poo
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- PooResponsePub
- 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
- SleepResponsePub
- 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 HungerResponsePub
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Function + 72)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Function + 81)
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub PooResponsePub
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Function + 36)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Function + 45)
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub SleepResponsePub
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Function + 54)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Function + 63)
- 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