Skip to content

Object Oriented One (OOO) or O³ (may also be known as ozone)

License

Notifications You must be signed in to change notification settings

Matsukii/Object-Oriented-One

Repository files navigation

Object-Oriented-One

Object Oriented One (OOO) or O³ (may also be known as ozone)

The One class in js, from this meme:

(author unknown, if don't want this img here, contact me)

Usage

Js

// JavaScript

// instance
const oneObj = new One();

// get the value
const one = oneObj.getOne();

// use it!
i = one + i;

// OR use directly
i = new One().getOne() + i;

// extra: setOne(<value>) (value must be 1)
oneObj.setOne(1);

Python

# Python

# instance
oneObj = One()

# get the value
one = oneObj.getOne()

# use it!
i = one + i

# OR use directly
i = One().getOne() + i

# extra: setOne(<value>) (value must be 1)
oneObj.setOne(1)

C++

// C++

int main(){
	  // instance
	  One oneObj = One();

	  // get the value
	  int one = oneObj.getOne();

	  // use it!
	  int i = one + i;

	  // OR use directly
	  int i = One().getOne() + i;

	  // extra: setOne(<value>) (value must be 1)
	  oneObj.setOne(1);

	  return oneObj.getOne();
}

LICENSE: MIT