# Verbose IPレンジジェネレータ

`a``b`
の2つのIPアドレスを指定すると、その範囲内のすべてのアドレスを出力するという単純な作業です。

# 例

``````f(a = 192.168.0.1, b = 192.168.0.4)
192.168.0.1
192.168.0.2
192.168.0.3
192.168.0.4
``````

``````f (a = 123.0.200.0, b = 124.0.0.0)
123.0.200.0
123.0.200.1
...            # Omitted pattern
123.0.200.255
123.0.201.0
...            # Omitted pattern
123.0.201.255
...            # Omitted pattern
123.0.255.255
123.1.0.0
...            # Omitted pattern
123.255.255.255
124.0.0.0
``````

# 入出力

• `a < b` in other words:

• Defined Programatically: ```a[0] < b[0] || (a[0] == b[0] && a[1] < b[1]) || (a[0:1] == b[0:1] && a[2] < b[2]) || (a[0:2] == b[0:2] && a[3] < b[3])```
• Defined in Words: `a` will always
be lower than `b` (so you will have to increment the
subnet to reach `b`).
• No, you do not have to handle ```a == b``` (if you do, kudos).
• Output should be in order from “lowest” to “highest” (see
例).
• For this challenge, the valid syntax for an IP is:
`d{1-3}.d{1-3}.d{1-3}.d{1-3}`.
• You do not have to handle non-IP address input, if it’s
unexpected input you may error.
• Output may be as an array or as a delimited string (using any
whitespace character).

# 勝つ

ベストアンサー

## バッチ、623バイト

``````@echo off
set s=%1.%2
call:c %s:.= %
exit/b
:c
if %1==%5 goto d
call:d %1 %2 %3 %4 %1 255 255 255
set/al=%1+1,u=%5-1
for /l %%i in (%l%,1,%u%)do call:d %%i 0 0 0 %%i 255 255 255
call:d %5 0 0 0 %5 %6 %7 %8
exit/b
:d
if %2==%6 goto e
call:e %1 %2 %3 %4 %1 %2 255 255
set/al=%2+1,u=%6-1
for /l %%j in (%l%,1,%u%)do call:e %1 %%j 0 0 %5 %%j 255 255
call:e %5 %6 0 0 %5 %6 %7 %8
exit/b
:e
if %3==%7 goto f
call:f %1 %2 %3 %4 %1 %2 %3 255
set/al=%3+1,u=%7-1
for /l %%k in (%l%,1,%u%)do call:e %1 %2 %%k 0 %5 %6 %%k 255
call:e %5 %6 %7 0 %5 %6 %7 %8
exit/b
:f
for /l %%l in (%4,1,%8)do echo %1.%2.%3.%%l
``````