This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
module.exports = [ | |
{ | |
mode: 'production', | |
context: path.join(__dirname, 'src', 'javascripts'), | |
entry: './application.js', | |
output: { | |
path: path.join(__dirname, 'docs/javascripts'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = IO.gets("N: ") |> String.trim |> String.to_integer | |
# 0から100の整数列を作成したのち、まず4か9を含みかつ1の位が4ではない整数列となるようにしその後素数だけを残す。 | |
IO.puts (0..100) |> Enum.map(fn(x) -> x end) |> Enum.filter(fn(x) -> Integer.to_string(x) |> String.match?(~r/(4\d)|9/) end) |> Enum.filter(fn(x) -> (2..(x - 1)) |> Enum.all?(fn(x2) -> rem(x, x2) != 0 end) end) |> Enum.slice(0, n) |> Enum.join(",") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a.step.lazy.select { |x| x != 1 && (2..(Math.sqrt(x).floor)).all? { |y| x % y != 0 } }.first |