Electronic Station

CheckIO Electronic Stationの問題和訳
問題ページのうち, 問題の前提となる小話は訳してません.
また各問題ページ下部にある「Precondition」は「前提条件」のため訳しません(数値の範囲などだけなので).


Letter Queue

First In, First Out. Next!

In computer science, a queue is a particular kind of data type in which the entities in the collection are kept in order and the principal operations on the collection are the addition of entities to the rear terminal position (enqueue or push), and removal of entities from the front terminal position (dequeue or pop). This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed.
We will emulate the queue process with Python. You are given a sequence of commands:
  • "PUSH X" -- enqueue X, where X is a letter in uppercase.
  • "POP" -- dequeue the front position. if the queue is empty, then do nothing.
The queue can only contain letters.
You should process all commands and assemble letters which remain in the queue in one word from the front to the rear of the queue.
Let's look at an example, here’s the sequence of commands:
["PUSH A", "POP", "POP", "PUSH Z", "PUSH D", "PUSH O", "POP", "PUSH T"]
Command Queue Note
PUSH A A Added "A" in the empty queue
POP Removed "A"
POP The queue is empty already
PUSH Z Z
PUSH D ZD
PUSH O ZDO
POP DO
PUSH T DOT The result

Input: A sequence of commands as a list of strings.
Output: The queue remaining as a string.

How it is used:
Queues provide services in computer science, transportation, and operations research where various entities such as data, objects, persons, or events are stored and held to be processed later. In these contexts, the queue performs the function of a buffer.

コンピュータサイエンスでは, キューはエンティティの順序を保持するコレクションで, 主要な操作は後方の端から行われるエンティティの追加(enqueueまたはpushと呼ばれる)と前方の端から行われるエンティティの削除(dequeueまたはpopと呼ばれる)である. これはFirst-In-First-Out(FIFO)構造である. FIFOデータ構造では, キューに最初に追加された要素は最初に削除される. これは新しい要素が追加されることが, 新しい要素が削除される前に以前に追加された全ての要素が削除されていなければならないことに相当する.
pythonでのキューのプロセスをエミュレートしよう. あなたにはコマンドのシーケンスが与えられる.
  • "PUSH X" はXをキューに追加する, ここでのXは大文字の文字である.
  • "POP" はキューの先頭の文字を削除する. もしキューが空なら, 何もしない.
キューは文字のみを含む.
あなたは全てのコマンドを処理し, キューに残った文字を, 先頭から後方に向かって組み立てる.
例を見てみよう. 次のコマンドを実行するとする.
["PUSH A", "POP", "POP", "PUSH Z", "PUSH D", "PUSH O", "POP", "PUSH T"]
Command キュー メモ
PUSH A A 空のキューに"A"を追加
POP "A"を削除
POP キューは空なので何もしない
PUSH Z Z
PUSH D ZD
PUSH O ZDO
POP DO
PUSH T DOT 結果

入力:文字列のリストとしてコマンド.
出力:キューに残った文字を文字列として.

備考
キューはコンピュータサイエンス, 輸送, オペレーションズリサーチなどにおいて, データ, オブジェクト, 人, イベントなどが格納され文字として保持されているような様々なエンティティを提供する. これらの環境では, キューはバッファとして機能する.

The Hamming Distance

Calculate the binary Hamming Distance

The Hamming distance between two binary integers is the number of bit positions that differs (read more about the Hamming distance on Wikipedia).
For example:
   117 = 0 1 1 1 0 1 0 1
    17 = 0 0 0 1 0 0 0 1
     H = 0+1+1+0+0+1+0+0 = 3
You are given two positive numbers (N, M) in decimal form. You should calculate the Hamming distance between these two numbers in binary form.

Input: Two arguments as integers.
Output: The Hamming distance as an integer.

How it is used:
This is a basis for Hamming code and other linear error-correcting programs. The Hamming distance is used in systematics as a measure of genetic distance.
On a grid (ie: a chessboard,) the Hamming distance is the minimum number of moves it would take a rook to move from one cell to the other.

2つの2進数のハミング距離とは, ビットの位置の数の差である(詳しくはWikipediaを見てね).
たとえば
   117 = 0 1 1 1 0 1 0 1
    17 = 0 0 0 1 0 0 0 1
     H = 0+1+1+0+0+1+0+0 = 3
あなたに2つの正の10進数(N, M)が与えられる. あなたは2つの数の2進表記からハミング距離を計算する必要がある.

入力:2つの整数
出力:ハミング距離, 整数

備考
これはハミング符号や他の線形エラー訂正問題の基礎だ. ハミング距離は体系学でよく使われる一般的な距離の指標だ.
チェスボードのようなグリッドでは, ハミング距離はルークの移動の最小値である.

Numbers Factory

Deconstruct and reconstruct numbers to create a new number

You are given a two or more digits number N. For this mission, you should find the smallest positive number of X, such that the product of its digits is equal to N. If X does not exist, then return 0.
Let's examine the example. N = 20. We can factorize this number as 2*10, but 10 is not a digit. Also we can factorize it as 4*5 or 2*2*5. The smallest number for 2*2*5 is 225, for 4*5 -- 45. So we select 45.

Hints:
Remember prime numbers (numbers divisible by only one) and be careful with endless loops.

Input: A number N, an integer.
Output: The number X, an integer.

How it is used:
This task will teach you how to work with numbers in code. You can factorize numbers and reconstruct them into new numbers.
Of course you can solve this problem with brute force, but is that the best way? Numbers are the foundation of mathematics and programming.

あなたに二桁以上の数Nが与えられる. このミッションでは, あなたはNの1桁の因数を桁とする最小の整数Xを見つけ出す必要がある. Xが存在しないなら0を返す.
たちえば, N = 20のとき, 私たちは因数分解して2*10を得るが, 10は1桁ではない. 他にも4*5や2*2*5を得る. 225と45のうち最小の数は45だ. よって45を選ぶ.

ヒント
素数を保持しておくとよい, また無限ループに注意.

入力:整数N
出力:整数X

備考
このタスクは数の扱いをあなたに教える. あなたは因数分解し, 再構築して新しい数を得られる.
もちろん, あなたは力技(brute-force)で解くこともできるが, それが最良の方法かな? 数は数学とプログラミングの基礎だ.

Brackets

Check to see that the brackets have been implemented correctly

You are given an expression with numbers, brackets and operators. For this task only the brackets matter. Brackets come in three flavors: "{}" "()" or "[]". Brackets are used to determine scope or to restrict some expression. If a bracket is open, then it must be closed with a closing bracket of the same type. The scope of a bracket must not intersected by another bracket. For this task, you should to make a decision to correct an expression or not based on the brackets. Do not worry about operators and operands.

Input: An expression with different of types brackets. A string (unicode).
Output: The correctness the expression or don’t. A boolean.

How it is used:
When you write code or complex expressions in a mathematical package, you can get huge headache when it comes to excess or missing brackets. This concept can be useful for your own IDE.

あなたに数と演算子と括弧だけの数式が与えられる. このタスクでは括弧のことだけ注目する. 括弧は"{}"と"()"と"[]"の3つがある.
括弧はスコープを決定したり, いくつかの数式に制限を与えるために使われる. もし括弧が開いていたら, それは同じタイプの括弧で, 近い位置で閉じられていなければならない.
括弧のスコープはほかの括弧を横切ってはならない. このタスクを解くために, あなたは数式が正しいかどうか, または括弧が間違っていると教えなければならない. 演算子などについては心配しなくてもよい.

入力:異なる括弧を含む数式, 文字列(unicode)
出力:数式が正しいかどうか, boolean

備考
あなたのコードや数学パッケージの複雑な数式などで, あなたは括弧の過多, 欠如で頭痛を抱えるだろう. このコンセプトはあなたのIDEで役に立っている.

Restricted sum

Find a sum of numbers without using the banned words.

Our new calculator is censored and as such it does not accept certain words. You should try to trick by writing a program to calculate the sum of numbers.
Given a list of numbers, you should find the sum of these numbers. Your solution should not contain any of the banned words, even as a part of another word.

The list of banned words are as follows:
sum
import
for
while
reduce

Input: A list of numbers.
Output: The sum of numbers.

How it is used:
This task challenges your creativity to come up with a solution to fit this mission's specs!

私たちの新しい計算機は検閲されていて, 特定の単語が使えない. あなたは数の和を計算するプログラムをトリッキーな方法で書く必要がある.
数のリストが与えられ, あなたはそれらの和を計算する. あなたの答えは制限された単語を含んではいけない.
制限されている単語は以下のとおり.
sum
import
for
while
reduce

入力:数のリスト
出力:数の和

備考
このタスクはミッションのスペックに合わせて解決策を考え出す, あなたの創造力への挑戦である!

Find Sequence

Search a matrix for a sequence of numbers

You are given a matrix of NxN (4≤N≤10). You should check if there is a sequence of 4 or more matching digits. The sequence may be positioned horizontally, vertically or diagonally (NW-SE or NE-SW diagonals).

Input: A list of lists. Each list contains integers.
Output: A boolean. Whether or not a sequence exists.

How it is used:
This concept is useful for games where you need to detect various lines of the same elements (match 3 games for example). This algorithm can be used for basic pattern recognition.

あなたにNxN(4≤N≤10)の行列が与えられる. あなたは4つ以上の同じ数字が並んでいるかどうかをチェックする. シーケンスは水平, 垂直, そして斜めがある.

入力:リストのリスト, 要素は整数
出力:boolean, シーケンスがあるかどうか

備考
このコンセプトは同じ要素のさまざまな線の検出を必要とするゲームで使われる. このアルゴリズムは基本的なパターン認識で使われる.

Numbered triangles

Help the robots win with the highest score that can be achieved in a triangle game

Our robots like games that require the ability to calculate equations. Mission control recently sent them the new game to occupy their time while flying from one Island to the next. This game is called "Numbered Triangles". Players take 6 chips from the pile, each chip is made of an equilateral triangle with three numbers one on each edge. You can move, rotate and flip the chips so they form a hexagon. The hexagon is only legal if the adjacent edges for each triangle have matching numbers.
The score for a legal hexagon is the sum of the numbers on the outside six edges. The player's goal is to find the highest score that can be achieved with the given six chips.
Each chip is represented as a list with three positive numbers. You should help the robots find the highest score for the given chips and return the score as a number. If you cannot form legal hexagon from the chips, then return a score of 0.

Input: The chip info as a list of lists. Each list contain three integers.
Output: The highest possible score as an integer.

How it is used:
This concept is used in optimization systems; you have constraints but you should work to get the most with these constraints. Of course this algorithm can be useful for the realisation of gameplay mechanics.

私たちのロボットは数式を計算する能力が必要なゲームが好きだ. ミッションコントロールは最近次の島に行くまでの暇つぶしのために, 新しいゲームを送ってきた.このゲームは"Numbered Triangles"と呼ばれる. プレイヤーは山から6枚のチップをとる. それぞれのチップは3つの数字が端に書かれた三角形で出来ている. あなたはチップを 回転や反転させて6角形を作る. この6角形はそれぞれの三角形の隣り合う辺の数字が一致しなければならない.
外側の数値の和が, 出来た6角形のスコアとなる. プレイヤーのゴールは与えられた6枚のチップからもっとも高いスコアを探し出すことである.
それぞれのチップは3つの整数からなるリストとして表現される. あなたはロボットが与えられたチップを使って最高のスコアを探し出すことを手助けし, スコアを整数として返す必要がある. もし6枚のチップからそのような6角形が作れない場合, 0を返す.

入力:チップの情報としてリストのリスト. それぞれのリストは3つの整数を持つ.
出力:可能なスコアのうちもっとも高いスコアを整数で.

備考
このコンセプトは最適化システムで使われる, あなたは制約条件の中でもっとも高いものを得る必要がある. もちろん, このアルゴリズムはゲームプレイ技術の実現としてよく使われる.

メモ
+ ...
全探索(すなわち, すべての6角形の場合をしらみつぶしに探して, 6角形になるもののうちもっとも高いスコアを出せばよいが, 全探索時のオーダーはかなり大きい.

Three Points Circle

Using three points and code, build a circle for Nikola.

Nicola discovered a calliper inside a set of drafting tools he received as a gift. Seeing the caliper, he has decided to learn how to use it.
Through any three points that do not exist on the same line, there lies a unique circle. The points of this circle are represented in a string with the coordinates like so:
   "(x1,y1),(x2,y2),(x3,y3)"
Where x1,y1,x2,y2,x3,y3 are digits.
You should find the circle for three given points, such that the circle lies through these point and return the result as a string with the equation of the circle. In a Cartesian coordinate system (with an X and Y axis), the circle with central coordinates of (a,b) and radius of r can be described with the following equation:
   "(x-x0)^2+(y-y0)^2=r^2"
where x0,y0,r are decimal numbers rounded to two decimal points. Remove extraneous zeros and all decimal points, they are not necessary. For rounding, use the standard mathematical rules.

Input: A string with coordinates.
Output: The equation of the circle as a string.

How it is used:
This equation, also known as Equation of the Circle, comes from the Pythagorean theorem when applied to any point on a circle: the radius is the hypotenuse of a right-angled triangle whose other sides are of length x − a and y − b. Of course you can use this concept for you mathematics software, but we just want to remind about how awesome circles are.

ニコラはギフトとして受けとった製図器のセットの中にあるカリパスを発見した. カリパスを見ると, 彼は使い方を学ぶためにあることを決めた.
同一線上に存在しない任意の3点を通るように描くと, それは円になる. この円のポイントは座標の文字列として以下のように表現される.
   "(x1,y1),(x2,y2),(x3,y3)"
ここで, x1,y1,x2,y2,x3,y3はすべて数値である.
あなたは与えられた3点から円を見つける必要がある. 3点を通る円は円の方程式を文字列として返す. デカルト座標(X軸とY軸を持つ)では, 円は中心の座標(a,b)と, 半径rを用いて以下の方程式で表記される.
   "(x-x0)^2+(y-y0)^2=r^2"
ここで x0,y0,rは小数点第2位で丸められた10進数である. 小数点以下が0の場合は取り除く, それらは必要ない. 丸めには標準的な数学のルールを用いる.

入力:3つの座標の文字列
出力:円の方程式を文字列として

備考
この方程式は, 円の方程式として知られており, 円上の任意の点に適用するときは, ピタゴラスの定理から, 半径は右直角三角形の斜辺であり, 残りの辺の長さはx - aとy - bとなる. もちろん, あなたの数学的なソフトウェアのために, この問題を使うこともできるが, 円の方程式の求め方について忘れないでほしい.

メモ
+ ...
カリパス(キャリパー)はコンパスのようなもの. デカルト座標は普通のX軸, Y軸からなる直交座標のこと.

Radiation search

Search for contaminated cargo and number unions.

The robots have learned that the last container which they picked up during a supply stop on another island is radioactive. There are five different kinds of spare parts contained within marked by number. The radiation is emitted from the largest group of identical spare parts (where each part is adjacently joined). Help them find this group and point out the quantity of identical parts within the group as well as the number of the spare part itself in the container.
The container is represented as a square matrix A (3≤|A|≤10). The numbers 1 through 5 are used to label the different kinds of spare parts -- the elements of A. Zero is an empty cell. Find the largest group of identical numbers adjacently joined to each other and point out both the quantity of the spare parts within the group and the number of the spare part itself.

Input: A square matrix as a list of lists. Each list contains integers
Output: The size and marking of the largest group as a list of two integers.

How it is used:
In this task, you can learn about Union-finding algorithms and Disjoint-set data structures. It can be used in image recognition, geographic analysis and even model the partitioning of a set.

ロボットは, 彼らが別の島に供給停止した際に拾った, 最後のコンテナが放射性であることを学んだ. 数字のマークがついた5種類のスペアパーツがある. 放射は同一のスペアパーツ(それぞれのパーツは隣接してつながっている)のもっとも大きなグループから出る. このグループを見つけて, グループ内の同一のパーツの量を出すと, コンテナの中のスペアパーツの数がわかる.
コンテナはサイズA(3≤|A|≤10)の正方行列として表現される. 1から5の数字はスペアパーツの種類を指す. 0は空のセルだ. 隣り合っている同一の数のグループのうち, もっとも大きなものを見つけると, スペアパーツの数がわかる.

入力:リストのリストとして渡される正方行列. それぞれのリストは整数を含む.
出力:もっとも大きなグループのマークと大きさを2つの整数のリストとして.

備考
このタスクでは, あなたはUnion-Findingアルゴリズムと, 素集合データ構造について学ぶことが出来る. それらは画像認識や地形分析, 集合の分割モデルとして使われる.

Parse Array

The parser is broken and requires repair.

In this task you you already have the solution. The problem is that it has a bug and you must try to find and fix it. "import", "exec" and "eval" don't work for this task.
You are given a string that contains a list with integers or nested lists. The integers could have single plus or minus sign before them. If the input string does not contain an array, then raise ValueError. For an incorrectly formatted string -- raise ValueError. Elements of the array are separated by commas.

Input: A string.
Output: The list with nested lists or integers.

How it is used:
This task is designed for you to show off your bug hunting skills. The parser code itself can be modified and improved to work as part of a larger more complex parsing system.

このタスクでは, あなたは既に解を持っている. それにはバグがあり, あなたはバグを見つけ直さなければならない. ただし, "import", "exec", "eval"はこのタスクでは使ってはならない.
あなたには整数またはネストしたリストの文字列が与えられる. 整数は数の前に符号がある. 入力文字列が配列でないなら, ValueErrorを返す. 不正な形式の文字列もValueErrorだ. 配列の要素はカンマで区切られる.

入力:文字列
出力:ネストしたリストから, 整数のリスト

備考
このタスクはあなたのバグハンティングスキルを見るために作られた. 複雑な解析システムではパーサーコード自身は改造, 改良されている.

メモ
+ ...
pythonデバッガ(pdb, ないしpython -m pdb filenameで実行)を使ってステップ実行して挙動を確認しながらやったらできた.

How much gold

Determine how pure a gold ingot is.

Our Favorite Trio has found a mysterious metal bar. This bar appears to be made of various metal including gold, iron, copper and tin. The bar does not contain any other metal except these. We do not know the quantity of each metal in the bar, but we do know the proportions of the various alloys. For example: the gold and tin proportion is 1/2, gold and iron -- 1/3, gold and copper -- 1/4. "the gold and tin proportion id 1/2" means that gold and tin together (their sum, not their ratio!) are the 1/2 of the whole bar (the sum of them all). You should calculate the proportion of gold in the entire bar.
The proportions are given as a dictionary where keys are alloy names and values are proportions. The alloy names are presented as strings, which are composed of two metal names separated by a dash (Ex: "gold-tin", "iron-copper", "iron-gold"). The proportions are presented as fractions (fractions.Fraction date type. Read about this module).
You should return the proportion of gold in the bar as a fraction (fractions.Fraction).

Input: Alloys names and proportions. A dictionary.
Output: Proportion of gold. A fractions.Fraction.

How it is used:
This task teaches you how to work with the Fraction data type. Fraction is very useful data type when you work with fractional numbers and want to avoid the float-rounding problem. You can learn how to use equation sets and pick out information from the combined data.

私たち仲良し3人組は, 不思議な金属のインゴットを見つけた. このインゴットは金, 鉄, 銅そして錫からなる. インゴットはそれら以外の金属を含んでいない. 私たちはインゴットの中のそれぞれの金属の量を知らないが, 合金としての割合は知っている. たとえば, 金と錫は1/2, 金と鉄は1/3, 金と銅は1/4だとする. 「金と錫の割合が1/2」というのは金と錫を合わせて, インゴットの1/2の重さであることを意味する. あなたはインゴットの中の金の割合を計算する必要がある.
割合は合金の名前をキーとした辞書として与えられる. 合金の名前は文字列として, ダッシュによって区切られた2つの金属名として表現される(例: "gold-tin", "iron-copper", "iron-gold"). 割合は分数として表現される(fractionsモジュールのFraction型).
あなたはインゴットの中の金の割合を分数として返す.

入力:合金の名前と割合, 辞書
出力:金の割合, Fractionで

備考
このタスクはあなたにFraction型の使い方を教える. Fractionは分数や, 浮動小数点の丸め問題を回避するため非常によく使われるデータ型である. あなたは複合したデータから式のセットと情報を取り出すことを学ぶことが出来る.

Minesweeper

Learn to play the game "Minesweeper” all over again with coding!

Minesweeper is a popular classic computer game. The object of the game is to clear an abstract minefield without detonating a mine. The player is initially presented with a grid of undifferentiated squares. Some randomly selected squares, unknown to the player, contain mines. The size of the grid is typically 10x10. The game is played by revealing various squares of the grid. If a square containing a mine is revealed, it detonates and the player loses the game. When a non-mined square is clicked, a digit is revealed in the square. This indicates the number of adjacent squares (typically, out of the possible eight) that contain mines. In typical implementations, if this number is zero then the square appears blank, and the surrounding squares are automatically revealed. You should open all cells without mine or mark all mines.
Let's learn the rules:
  • If you uncover a mine, the game ends.
  • If you uncover an empty square, you can keep playing.
  • If you mark as mine a mined cell, you can keep playing.
  • If you uncover a number, it will tell you how many mines lay hidden beneath the eight surrounding squares—use this information to deduce which nearby squares are safe to click on.
  • If you mark as mine a cell without mine, the game ends.
  • If you uncover already opened cell, the game ends (we don't like perpetual game.).
On each iteration, the checkio function got a field's map as argument. The map is presented as a list of list. Each cell on the map can be marked as: -1 -- not opened cells, 9 -- a mine, a number from 0 to 8 -- a count of the number of mines surrounding the cell. Your checkio function must return a tuple or a list of three values. The first value reflects whether there is a landmine on the following coordinates (true or false). The second and third values are the coordinates in the passed field map (field[i][j]). For starting the game you can use [0, 0] cell -- it is empty always.

Input: A field map. A list of lists.
Output: A tuple or a list with next values: is it a mine as boolean, row and column as integers.

How it is used:
Of course the goal of this task is to show that you have the skills to write a bot for the original Windows game and save your colleagues from procrastination. These skills can also help with more serious problems and can be used in prediction and decision systems.

マインスイーパはポピュラーで古典的なゲームだ. このゲームの目的は地雷を爆発させることなく, 仮想の地雷原をクリアにすることだ. プレイヤーにはまず未分化の正方グリッドが与えられる. いくつかのスクエアには, プレイヤーに知られることなく, 地雷が置かれる. グリッドのサイズは10x10だ. このゲームはグリッドのスクエアを明らかにすることによってプレイされる. もし地雷を含んだスクエアが明らかにされると, それは爆発し, プレイヤーはゲームに敗北する. 地雷のないスクエアをクリックしたとき, スクエアには数字が表示される. この数字は隣接8マスに含まれる地雷の数を示している. 典型的な実装として, 数字が0の場合スクエアは表示せず, 周囲のスクエアを自動的に明らかにする. あなたは地雷を爆発させることなく, または全ての地雷にマークをつけて, すべてのセルを開く必要がある.
ルールをまとめよう.
  • 地雷を開くと, ゲームは終了.
  • 空のスクエアを開くと, ゲームは続行.
  • 地雷のあるセルをマークしても, ゲームは続行.
  • 数字を開いたら, それはその周囲8セルにある地雷の数を教えてくれ, 近くの安全なセルを推測させてくれる.
  • 地雷のないところに地雷マークをつけると, ゲームは終了
  • 既に開いているセルを開くと, ゲームは終了
繰り返しのうえで, checkio関数はフィールドのマップを引数として受け取る. マップはリストのリストとして表現される. マップのそれぞれのセルは次のようにマークされる.
  • -1 開いていないセル
  • 9 地雷
  • 0-8 周囲のセルにある地雷の数
あなたのchekcio関数はタプルかリストで3つの値を返す. 最初の値は座標上のセルが地雷かどうか(TrueかFalse). 残り2つは座標だ. あなたは[0, 0]からゲームを始める, ここは常に空だ.

入力:フィールドマップ, リストのリスト
出力:タプルかリスト, 地雷かどうかのbooleanと, 座標を指す行と列

備考
もちろんこのタスクのゴールはオリジナルのwindowsのゲームのためのbotを書くあなたのスキルを見るためと, 先延ばしからあなたの同僚を守るためだ. これらのスキルはより重大な問題の助けや予報, 決定システムでよく使われる.

Bit Message

Decode a message

The Bit Message is a message that is hidden within the lines of an octet stream and it is represented as a hexadecimal string which has maximum length of 149 octets. The first 9 octets of the message contain the header for the message and the rest comprise the content. The header contains 1 type octet, 7 timestamp octets, and 1 message length octet. The content contains a maximum of 140 octets and could be packed with either 7 bit, 8 bit or 16 bit. 7 bit packed messages have a length of 160 characters, 8 bit packed messages have a length of 140 characters, and 16 bit packed messages will only have a length of 70 characters.

Input data: A hexadecimal string that is a bit message (unicode).
Output data: A list containing the timestamp, length of message and the message itself. The message is unicode.

Bit Messageはオクテットストリームに隠されたメッセージで, それは最大149オクテットの長さの16進数の文字列として表現される. 最初の9オクテットは, メッセージのヘッダーであり, メッセージの情報が格納されている. ヘッダーの1オクテットはメッセージの種類を指し, 7オクテットはタイムスタンプを, 残りの1オクテットはメッセージの長さである. メッセージ自体は最大140オクテットであり, (メッセージの種類によって)7bit, 8bit, 16bitパックになっている. 7bitパックのメッセージは160文字, 8bitパックのメッセージは140文字, 16bitパックの文字は70文字までとなっている.

入力:ビットメッセージとして16進数の文字列(unicode)
出力:タイムスタンプ, メッセージとメッセージの長さを含んだリスト, メッセージはunicode.

メモ
+ ...
オクテット(octet)は8bitのこと, 1byteは処理系によって8bitとは限らない.
最終更新:2014年07月08日 20:05