Author Topic: Probably Pointless Program  (Read 31466 times)

0 Members and 1 Guest are viewing this topic.

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Probably Pointless Program
« on: September 30, 2010, 10:33:03 pm »
So my dad has challenged me to make a calender program in TI-BASIC, but every now and then the text output gets screwed up and i don't know whats wrong. It seems to happen only when using larger years like 2000 but it work fine with the year 1. Help?

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Probably Pointless Program
« Reply #1 on: September 30, 2010, 10:35:27 pm »
describe what happens. or screeny plz.

Maybe you can only use 1 byte?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Probably Pointless Program
« Reply #2 on: September 30, 2010, 10:40:30 pm »
Cant post a screenshot now but what happens is the numbers for the days fail to appear

-----------------------
l  January   Year:2000  l
-----------------------
l 1 l 2 l 3 l 4 l 5 l 6 l 7 l
-----------------------
l    l    l    l    l    l    l   l
-----------------------

And everything past is plank

or it skips the first two weeks of the month

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Probably Pointless Program
« Reply #3 on: September 30, 2010, 10:42:20 pm »
Well I just tried, haven't gone over the code yet, but I can't get it to display over the year 700. Granted, I only used Sept.

Edit:
Weird, it works for Jan. 1995. Hmmm...

Edit:
Still going over code but fPart(C/7)*7→D can be 7fPart(C/7→D.

Edit:
Ok, I think I figured it out. I haven't fully tested it but it seems to have. That line I just optimized for you actually needs to be iPart(7fPart(C/7→D. That should fix it.

Edit:
Got bored so I optimized your program some. I'm sure some of it can be optimized more/better but oh well. Shaved off 70 bytes.
« Last Edit: October 01, 2010, 01:09:53 am by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Probably Pointless Program
« Reply #4 on: October 02, 2010, 04:47:03 pm »
Hey guy6020665, did you see my post above? I'm pretty sure that is what fixes it. (Since 7fPart(C/7→D didn't always return just a integer there was no way it could be equal to the integers in the display routine. But getting the integer part of it will keep that number as an integer the rest of the time.)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Probably Pointless Program
« Reply #5 on: October 02, 2010, 09:44:41 pm »
Ah, ok thanks. Sorry didn't check this when I was on earlier.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Probably Pointless Program
« Reply #6 on: October 02, 2010, 09:47:29 pm »
Actually, round() is better than iPart() in this case. You never know when the result might be 3.999999999 and iPart returns 3.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Probably Pointless Program
« Reply #7 on: October 02, 2010, 10:03:20 pm »
So many little things that I forgot about  :-[

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Probably Pointless Program
« Reply #8 on: October 02, 2010, 10:08:53 pm »
Actually, round() is better than iPart() in this case. You never know when the result might be 3.999999999 and iPart returns 3.

Oh, right. I don't know the actual formula for calculating all this so I didn't think about using round(.

So many little things that I forgot about  :-[

No worries, we all do it from time to time :)
« Last Edit: October 02, 2010, 10:10:01 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Probably Pointless Program
« Reply #9 on: October 03, 2010, 04:59:47 am »
Off-topic, but meishe91, when you have multiple edits, you should really bump your thread after 6 hours with no replies. Else, people won't notice if 40 other topics get bumped in the meantime.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Probably Pointless Program
« Reply #10 on: October 03, 2010, 05:25:08 am »
Ya, I know. I just avoid double posting if I can (even after the time limit :P). I just figured he would have checked it again so I waited.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Probably Pointless Program
« Reply #11 on: October 03, 2010, 01:20:13 pm »
Personally I don't mind past the limit, since then you get ignored most of the time x.x

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Probably Pointless Program
« Reply #12 on: October 03, 2010, 02:53:05 pm »
Ok program fixed, it now actually gives a correct calender, before it was off by a few days, meishe91 i haven't been able to check your version yet so i will assume that you just optimized and did not get a correct calendar because in my idiocy i forgot to post that problem. Will add in correct calendar to meishe91's version and upload it when i can

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Probably Pointless Program
« Reply #13 on: October 03, 2010, 04:02:49 pm »
Well mine gives someone the right calendar apparently. I mean I checked the one for September 2010 and it worked and seemed to work. What was the problem with it?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Probably Pointless Program
« Reply #14 on: October 03, 2010, 04:09:44 pm »
I haven't been able to check yours but the one i uploaded sometimes gave the wrong calender depending on the year, i did leap years wrong so sometimes the month started on a wrong day of the week..