Anonymous user
Odd word problem: Difference between revisions
→{{header|Go}}
Line 33:
func owp(dst io.Writer, src io.Reader) {
}
byte_out := func (b byte) { dst.Write([]byte{b}) }
var odd func(byte) byte
odd = func(s byte) byte {
if unicode.IsPunct(rune(s)) {
return s
}
▲ dst.Write(b)
▲ return s
}
for {
for {
if b
return
}
if unicode.IsPunct(rune(b
break
}
}
if b[0] == '.' {▼
return
}
Line 87 ⟶ 90:
func owp(dst io.Writer, src io.Reader) {
src.Read(bs)
}
byte_out := func (b byte) { dst.Write([]byte{b}) }
odd := func() byte {
for {
if unicode.IsPunct(
return b
}
defer
}
panic("impossible")
}
for {
for {
if b
return
}
if unicode.IsPunct(rune(b
break
}
}
b := odd()
if b
return
}
|