The following warnings occurred:
Warning [2] Undefined array key 168914 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168917 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168919 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168953 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168917 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168919 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 168953 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP 35s Day of the week program



#3

Hi all, I was watching a tv show about an extraordinary man who calculates mentally the day of the week of any date. Then I wrote this program for the HP 35s that uses one of that algorithms.

DAY OF THE WEEK FOR HP 35s (FROM 1901 TO 2099)

Table of Contents
=================
1 Using the program
2 Program listing
3 Registers
4 Revision

1 Using the program
~~~~~~~~~~~~~~~~~~~~

First execute the program: XEQ W ENTER.
Insert the day and press R/S.
Insert the month and press R/S.
Insert the year (from 1901 to 2099) and press R/S.

Then it will show a number that corresponds to the
day of the week according to this table:

Day Number
-----------+--------
Sunday 0
Monday 1
Tuesday 2
Wednesday 3
Thursday 4
Friday 5
Saturday 6

2 Program listing
~~~~~~~~~~~~~~~~~~

Line Instruction
------+--------------------
W001 LBL W
W002 INPUT D
W003 INPUT M
W004 INPUT Y
W005 033614625035
W006 1E13
W007 10
W008 RCL M
W009 y^x
W010 ÷
W011 ÷
W012 FP
W013 10
W014 x
W015 IP
W016 STO N
W017 RCL Y
W018 4
W019 RMDR
W020 x!=0? ;(not equal)
W021 GTO W038
W022 RCL Y
W023 100
W024 RMDR
W025 x!=0? ;(not equal)
W026 GTO W032
W027 RCL Y
W028 400
W029 RMDR
W030 x!=0? ;(not equal)
W031 GTO W038
W032 RCL M
W033 3
W034 x>y?
W035 GTO W038
W036 1
W037 STO+ N
W038 RCL Y
W039 1
W040 -
W041 ENTER
W042 ENTER
W043 ENTER
W044 100
W045 INT÷
W046 1
W047 +
W048 4
W049 INT÷
W050 -3
W051 x
W052 x<>y
W053 4
W054 INT÷
W055 +
W056 +
W057 RCL N
W058 +
W059 RCL D
W060 +
W061 7
W062 RMDR
W063 STO W
W064 VIEW W
W065 RTN

234 Bytes

3 Registers
~~~~~~~~~~~~

Register Use Notes
----------+-----------------+----------------
D Day of month
M Month
Y Year
N Modulus Internal usage
W Day of the week

4 Revision
~~~~~~~~~~~

06/23/10 - Initial release


Edited: 23 June 2010, 5:29 p.m. after one or more responses were posted


#4

Sorry, there is a problem with leap years. I will fix it.

#5

Fixed.

#6

Hello Pablo,

Thanks for the program. I think I saw the show about the man who could tell the day of the week for any given date. There was a discussion here a while back about a method to determine on which day of the week the last of February, 7 March, 4 April, 9 May, 6 June, 11 July, 8 August, 5 September, 10 October, 7 November and 12 December will fall in a given year. From there you can quickly figure what day of week any other date will fall. It was called the "doomsday" method, but I preferred to think of it as the "magic day", so that's what I called the program I wrote to calculate it. The meat of the program is the equation below, which was found at the links in message 8 of the discussion.

RMDR((2+REGX+IP(REGX/4)-IP(REGX/100)+IP(REGX/400),7)

The year you are interested in must be in stack register x.

.

Edited: 25 June 2010, 1:17 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  An amazing day: Giving a talk at HP about their calculators Geir Isene 9 4,451 12-16-2013, 06:14 PM
Last Post: aurelio
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,616 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Interesting Base Conversions - Porting a 1975 HP 25 Program to the HP 35S Eddie W. Shore 1 1,314 10-13-2013, 07:49 PM
Last Post: BruceH
  HHC 2013 Day 2 Highlights Eddie W. Shore 6 2,489 09-23-2013, 04:03 PM
Last Post: Kimberly Thompson
  HHC 2013: Day 1 Highlights Eddie W. Shore 28 7,683 09-23-2013, 03:22 PM
Last Post: Brad Barton
  Flash Flood Warning: 9/16/2013 (One Week from HHC13) Eddie W. Shore 8 2,796 09-17-2013, 09:20 PM
Last Post: Craig Ruff
  HHC 2013: One Week To Go Eddie W. Shore 2 1,446 09-13-2013, 05:32 PM
Last Post: Craig Ruff
  Auction Scam of the Week? Frido Bohn 4 1,936 06-03-2013, 01:45 PM
Last Post: Mike Morrow
  Planar Triangles Program: HP 35S Eddie W. Shore 0 855 06-02-2013, 11:15 AM
Last Post: Eddie W. Shore
  Happy Mother's Day! Eddie W. Shore 1 1,167 05-12-2013, 11:35 AM
Last Post: Walter B

Forum Jump: