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
<html> | |
<head><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css"> | |
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="index.js" type="text/babel"></script> | |
</body> |
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
# Convert ["a", nil, "b", "c", nil] and ["d", nil, "e", "f"] into ["af", "be", "cd"] using Ruby in one sentence | |
# Hint: Remember, Do it in one sentence. | |
# Solution: | |
## Remove nils from both arrays using compact | |
## Reverse second array | |
## Zip both arrays then map the resulting array joining the values in chunks of two | |
["a", nil, "b", "c", nil].compact.zip(["d", nil, "e", "f"].compact.reverse).map { |a, b| "#{a}#{b}" } |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import pygame | |
from pygame.locals import * | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
class Shape: | |
def __init__(self, vertices, edges): | |
self.vertices = vertices |