Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete function GO #477

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,8 @@ Name: [Jay](https://github.com/TacticalTechJay) </br>
Place: Milky Way Galaxy </br>
Coding Experience: Semi-noob in JS. </br>
Email: [email protected] </br>

Name: [GaslightGod](https://github.com/GaslightGod) </br>
Place: Heart and soul of all Americans </br>
Coding Experience: Sophomore @ JS, Freshman @ GO, PY. </br>
Email: [email protected] </br>
14 changes: 14 additions & 0 deletions go/delete/GaslightGod_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main
/*
go run remove_element.go
One-liner element deletion in go
*/

import "fmt"

func main() {
testArr := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
fmt.Println(d2(testArr, 3)) // Removes 4
}

func d2 (s []int, x int) []int { return s[:x+copy(s[x:], s[x+1:])] }
1 change: 1 addition & 0 deletions javascript/GaslightGod_isEquilateral.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const isEquilateral = (a, b, c, d) => a === b && a === c && a === d ? console.log('square') : console.log('not a square');
1 change: 1 addition & 0 deletions javascript/GaslightGod_perfectSquare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const perfect_square = n => n % Math.sqrt(n) ? 'Not a perfect square' : 'Square';