Skip to content

Instantly share code, notes, and snippets.

View romanitalian's full-sized avatar
🎯
Focusing

roman romadin romanitalian

🎯
Focusing
View GitHub Profile
<?php
function isPrime($num)
{
if ($num == 2) {
return true;
}
if ($num == 1 || $num %2 == 0) {
return false;
}
function isPrime(num) {
if (num === 2) {
return true;
}
if (num <= 1 || num % 2 === 0) {
return false
}
for (let div = 3; div <= Math.sqrt(num); div += 2) {
if (num % div === 0) {
return false;
package main
import (
"fmt"
"math"
"time"
)
func isPrime(num int) bool {
if num == 2 {
go version
go version go1.15.4 darwin/amd64
#include <iostream>
#include <cmath>
#include <time.h>
using namespace std;
bool isPrime(int num)
{
if (num == 2) {
return true;
g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Model Name: MacBook Pro
Model Identifier: MacBookPro14,1
Processor Name: Dual-Core Intel Core i5
Processor Speed: 2,3 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 4 MB
Hyper-Threading Technology: Enabled
Memory: 8 GB
pacakge img
const (
// Default setting
imgColorDefault = "E5E5E5"
msgColorDefault = "AAAAAA"
imgWDefault = 300
imgHDefault = 300
fontSizeDefault = 0
package colors
import (
"image/color"
"strconv"
)
type rgb struct {
red uint8
green uint8