ときどきの雑記帖″

最新ページへのリンク
目次ページへのリンク

一つ前へ 2014年7月(上旬)
一つ後へ 2014年7月(下旬)

ホームへ

2014年07月20日

■_

「新セーラームーンはリアリティが無い」という暴論。あるいはSEEDとザブングルどっちがリアルか問題 - Togetterまとめ のコメントの 「10数mの人型ロボットの動力源がガソリンで操縦系統はハンドル操作。そんなロボットアニメが現実的なはずがない。」バーチャロンdisってんのか? ザブングルの操縦はほんとーに「ハンドル」(ステアリングホイール) なんだけど、 バーチャロンもそうなんだっけ? ま、ザブングルもメインメカ(のザブングル)以外は良く覚えてないんだけど。

■_

■_

■_

ちょっと面白そうなんで読む Battleship Rangefinders and Geometry | Hacker News Battleship Rangefinders and Geometry | Math Encounters Blog

■_

Civilization の作者とのやりとりが面白かった Gamasutra - The History of Civilization

Gamasutra - The History of Civilization

An Interview With Sid Meier

What was the first computer you ever used?

Sid Meier: Well, that would be in college, I guess. It was an IBM 360 mainframe. We would submit batch
jobs to the mainframe and learn how to do FORTRAN programming. That would have been in the early '70s.

What was the first personal computer you ever used?

Sid: The first personal computer I had was an Atari 800. 16K of memory.

Do you remember the first computer game you ever played?

Sid: An arcade "Pong" game would probably have been the first computer game.

Did you every play anything like Hunt the Wumpus on mainframes back in the day?

Sid: I'm trying to remember. I actually wrote games. I did a "Star Trek" space game, and I believe
a tic‑tac‑toe game. I was fooling around with games even when I was supposed to be doing real work, back in
the early mainframe days.

What was the first computer game you ever created for personal computers?

Sid: When I got my 800, probably the first game I wrote was very similar to Space Invaders. It had little
creatures coming down and you shot them from the bottom of the screen. It was written in assembly language.
I didn't have a disk drive, so I saved it on a cassette tape, and I had to hand‑assemble it in assembly language.

おっさんホイホイなワードがビシバシ出てますねw

2014年07月19日

■_

セルオートマトン面白いな。 Elementary Cellular Automaton -- from Wolfram MathWorld Cellular Automaton -- from Wolfram MathWorld コッドのセル・オートマトン - Wikipedia

■_

2014年07月18日

■_

ややこしい事案は延期されますた。

■_

■_

Bare-metal な環境で動く~というので気になってちょっと読んでみた organix/pijFORTHos

organix/pijFORTHos

Raspberry Pi JonesFORTH O/S

A bare-metal operating system for Raspberry Pi, based on Jonesforth-ARM.

Jonesforth-ARM is an ARM port, by M2IHP'13 class members listed in AUTHORS, of x86 JonesForth.

(略)

What is this ?

pijFORTHos is a bare-metal FORTH interpreter for the Raspberry Pi. It follows the general strategy given
by David Welch's excellent examples. A simple bootloader is built in, supporting XMODEM uploads of new
bare-metal kernel images.

以下略

ふむ。

ソースコードもちょっと。

「パラメータスタック」じゃなくて「データスタック」と呼んでるのか
pijFORTHos/jonesforth.s at master · organix/pijFORTHos

       .set JONES_VERSION,47

@ Reserve three special registers:
@ DSP (r13) points to the top of the data stack
@ RSP (r11) points to the top of the return stack
@ FIP (r10) points to the next FORTH word that will be executed
@ Note: r12 is often considered a "scratch" register

DSP .req r13
RSP .req r11
FIP .req r10

@ Define macros to push and pop from the data and return stacks

        .macro PUSHRSP reg
        str \reg, [RSP, #-4]!
        .endm

        .macro POPRSP reg
        ldr \reg, [RSP], #4
        .endm

        .macro PUSHDSP reg
        str \reg, [DSP, #-4]!
        .endm

        .macro POPDSP reg
        ldr \reg, [DSP], #4
        .endm

        .macro PUSH2 reg
        stmdb \reg!, {r0-r1} @ ( -- r1 r0 )
        .endm

        .macro POP2 reg
        ldmia \reg!, {r0-r1} @ ( r1 r0 -- )
        .endm

        .macro PUSH3 reg
        stmdb \reg!, {r0-r2} @ ( -- r2 r1 r0 )
        .endm

        .macro POP3 reg
        ldmia \reg!, {r0-r2} @ ( r2 r1 r0 -- )
        .endm

        .macro PUSH4 reg
        stmdb \reg!, {r0-r3} @ ( -- r3 r2 r1 r0 )
        .endm

        .macro POP4 reg
        ldmia \reg!, {r0-r3} @ ( r3 r2 r1 r0 -- )
        .endm

@ _NEXT is the assembly subroutine that is called
@ at the end of every FORTH word execution.
@ The NEXT macro is defined to simply call _NEXT
        .macro NEXT
        b _NEXT
        .endm

@ jonesforth is the entry point for the FORTH environment
        .text
        .align 2 @ alignment 2^n (2^2 = 4 byte alignment)
        .global jonesforth
jonesforth:
        ldr r0, =var_S0
        str DSP, [r0] @ Save the original stack position in S0
        ldr RSP, =return_stack_top @ Set the initial return stack position
        ldr r0, =data_segment @ Get the initial data segment address
        ldr r1, =var_HERE @ Initialize HERE to point at
        str r0, [r1] @ the beginning of data segment
        ldr FIP, =cold_start @ Make the FIP point to cold_start
        NEXT @ Start the interpreter

@ _DOCOL is the assembly subroutine that is called
@ at the start of every FORTH word execution, which:
@ 0. expects the CFA of a FORTH word in r0
@ 1. saves the old FIP on the return stack
@ 2. makes FIP point to the DFA (first codeword)
@ 3. uses _NEXT to start interpreting the word
_DOCOL:
        PUSHRSP FIP
        add FIP, r0, #4

@ _NEXT is the assembly subroutine that is called
@ at the end of every FORTH word execution, which:
@ 1. finds the CFA of the FORTH word to execute
@ by dereferencing the FIP
@ 2. increments FIP
@ 3. begins executing the routine pointed to
@ by the CFA, with the CFA in r0
_NEXT:
        ldr r0, [FIP], #4
        ldr r1, [r0]
        bx r1

@ cold_start is used to bootstrap the interpreter,
@ the first word executed is QUIT
        .section .rodata
cold_start:
        .int QUIT

やはりこの名前かw>「DOCOL」と「NEXT」 意外に短いコードな気がするけど 8080あたりが(ぴー)なだけか。

2014年07月17日

■_

明日(金曜日)はいろいろとややこしいことが。

■_

2014年07月16日

■_

某社の暗黒面をちょっと見たり。

■_

ちょっと考えてみた。

Coffee Time Challenges

11) Product and Sum

Challenge: I’ve written down all the integers from 1 to 65,502 inclusive. I select two of them, cross them
out, and multiply them together to get a product. When I sum up the remaining 65,500 numbers, I get the
same result. What two numbers did I pick?

 
12) Adjacent Squares

Challenge: Arrange the integers 1-17 (inclusive) so that each adjacent pair of numbers is a perfect square.
e.g. 14, 2, 7 … (The first and last do not have to wrap around)


irb(main):001:0> [*1..65502].inject(:+)
=> 2145288753
irb(main):002:0> 65502*65501
=> 4290446502

11) の方はまじめに?力尽くでやろうとすると 65502C2 でとんでもないことになってしまうので その数を減らさなければいけないのだけど、さてどうやるのが良いのか。 元記事のヒントを見てしまうと What is the formula for triangular numbers? …どゆこと? いや、「三角数」はわかるんですけどね。 抜き取る二つの候補とどう関係してくるんだろう。

んで 12)のほうは

    25  16   9   4
17   8
16   9
15  10   1
14  11   2
13  12   3
12  13   4
11  14   5
10  15   6
 9  16   7
 8  17  (8)  1
 7       9   2
 6      10   3
 5      11   4
 4      12   5
 3      13   6   1
 2      14   7  (2)
 1      15   8   3

17 と 16 は相手になれる候補が一つしかないので、 それぞれがリストの端になることは確定。 んで、端と反対方向の隣に相手となる 8 と 9 を置くとさらにその隣が確定できるから…

2014年07月15日

■_

暑中見舞い的な何かを書いた。

■_

■_

Coffee Time Challenges 続き。

Coffee Time Challenges

7) Legs

Challenge: In a room there are a mixture of people and dogs. There are 72 heads, and 200 legs. How many dogs are in the room? (No tricks, no chromosomal abnormalities, no disabilities …)

これ、要するに鶴亀算なんですがヒントを見ちゃうとですね This is simple algebra. If you need to write code to solve this, please stop reading. だそうです。

Coffee Time Challenges

8) One, Two, Three

Challenge: Using just one 1, one 2, and one 3 (no concatenation of digits) and any combination mathematical
symbols you wish (addition, subtraction, multiplication, division, parenthesis, exponents, factorial,
square root …). Write an equation to gives the total 19.


9) One, Seven

Challenge: As above, how about making a total of 71 using just one 1 and one 7 (again, no concatenation
of digits, or this would be trivial!)

この二つはプログラム組むのは面倒? 前者は sqrt((3!)!/2 + 1) 後者は sqrt(7! + 1)

10) Buckets

Challenge: Put the numbers 1-13 into three buckets with the constraint that the difference between any two
pairs of numbers in any bucket is not a number also in that bucket. (e.g. If you place 5,7 in a bucket,
then you cannot place 2 in that same bucket).


11) Product and Sum

Challenge: I’ve written down all the integers from 1 to 65,502 inclusive. I select two of them, cross them
out, and multiply them together to get a product. When I sum up the remaining 65,500 numbers, I get the same
result. What two numbers did I pick?


12) Adjacent Squares

Challenge: Arrange the integers 1-17 (inclusive) so that each adjacent pair of numbers is a perfect square.
e.g. 14, 2, 7 … (The first and last do not have to wrap around)

13) How many

Challenge: ABCDEFGHIJ is a ten-digit-number. All of the digits are distinct. If 11111 divides it evenly,
how many possibilities are there for ABCDEFGHIJ?


14) Reciprocals

Challenge: Find six distinct integers: A, B, C, D, E, F the reciprocals of which add up to exactly one.
e.g. 1/A + 1/B + … 1/F = 1

  

この辺は単純な力業では組み合わせの威力の前に撃破されてしまうので さてどうしましょ。

2014年07月14日

■_

新卒の新人さんが来たよ

■_

2014年07月13日

■_

TNGパトレイバー観てきた。

■_

■_

欲しい。が値段がなあ…放り込むだけムダだからwishlistには入れない Amazon.co.jp: チェコの伝説と歴史: アロイス・イラーセク, 浦井 康男訳・註解: 本

2014年07月12日

■_

来週から。と。 「日本SF展・SFの国」が世田谷文学館で開催 - 手塚治虫や星新一、筒井康隆など | ニュース - ファッションプレス

■_

2014年07月11日

■_

有給休暇使ったw

プリニウス (1) (バンチコミックス45プレミアム)
プリニウス (1) (バンチコミックス45プレミアム) 買った。読んだ。

【すげえ】台風一過の虹をパノラマ撮影してみた結果wwwwwwww:キニ速 虹と言えば白熱教室ですね

NHK DVD MIT白熱教室 DVD BOX
NHK DVD MIT白熱教室 DVD BOX これが物理学だ! マサチューセッツ工科大学「感動」講義
これが物理学だ! マサチューセッツ工科大学「感動」講義

■_


一つ前へ 2014年7月(上旬)
一つ後へ 2014年7月(下旬)

ホームへ


リンクはご自由にどうぞ

メールの宛先はこちらkbk AT kt DOT rim DOT or DOT jp